Contract 0x2d22402a83f4416bf26e5e2fac10a053194f759d

Contract Overview

Balance:
0 FTM

FTM Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xf2cedd35dd3e6c5c14dfd55e1a0620e4c05f019c78276c5d6a9382a59dfff2a5Claim Many From ...391085622022-05-26 15:29:112 mins ago0xab28e0dee85fdea04b28db175c8bec64c99fe3f4 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM1.616912579107
0xd2ff102ec9da1650893c802992ebdec7d2773f256d32e1d9941510d02e82a626Claim Many From ...391082912022-05-26 15:24:057 mins ago0x1563c4751ad2be48fd17464b73585b6ba8b6a5f0 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM1.002436170973
0x4b1d14db6b3daa9f13e1ae711f8b2ca21b99341835bf5460c1b687ae1bc87b1fClaim Many From ...391076132022-05-26 15:11:3620 mins ago0xab28e0dee85fdea04b28db175c8bec64c99fe3f4 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM1.211546893707
0x5aa2bc216b13f3a1bb842eef8e4e89270b63961d5689bb7fe06c8942e5f5a963Claim Many From ...391070292022-05-26 14:59:1432 mins ago0xab28e0dee85fdea04b28db175c8bec64c99fe3f4 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.775935384969
0xebdadbd549f8dd111684a84899412932d7be17679e6545e2dbb25dd5f11e2c5fClaim Many From ...391063892022-05-26 14:47:3244 mins ago0xab28e0dee85fdea04b28db175c8bec64c99fe3f4 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.250772290771
0x244812cd8ac5786ed3ec51617b0502a1bcedb5f43617f05f718aa25eb089de6bAdd Many To Hide...391048132022-05-26 14:18:551 hr 13 mins ago0x26dcb0d7d48aa979da81f2fce331ce6e028b00d7 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.9762815
0x5662f7e1f7a47345889a19f05cbc88567e97034bb31f969edbb8d6a94fe4aa22Claim Many From ...391040732022-05-26 14:03:531 hr 28 mins ago0x5ab47f3fa75c7c0c414b6b2a833f3f1a8ae5eea9 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM2.23485498619
0xc85bb46d2abae9f3c387efa7aff34628e2f0da27c1b6aa9ea227bcbe11cbecc2Add Many To Hide...391014902022-05-26 13:02:152 hrs 29 mins ago0x26dcb0d7d48aa979da81f2fce331ce6e028b00d7 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.05876937583
0x1b015dd295005e74b33180586a537784c6e70ec61a5c6d34bde506245d64619fClaim Many From ...391014662022-05-26 13:01:442 hrs 30 mins ago0xc48d7775f79b8c7774bbba6f8490db8f6460ead9 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.034770640488
0x560c10038fe9f5877c5e2ef67a85f437c891fdf5cc9856d096ab156974abae95Add Many To Hide...390995682022-05-26 12:26:473 hrs 5 mins ago0x40c89c66487e57fcb2741cef63255ba06deadbfb IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.035854527289
0x5093c5c7ca8296415f7b5c9991038d4fd64bcbeb9e8534fa502dfeffbfe58d46Claim Many From ...390993052022-05-26 12:22:063 hrs 9 mins ago0x40c89c66487e57fcb2741cef63255ba06deadbfb IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.06846121758
0x2bac76ce2a553aca51d49d455dea6e80c771c15eb891c547b6931b4c190e7894Add Many To Hide...390970892022-05-26 11:39:383 hrs 52 mins ago0x905b42a4a9f366ccbc182ece8ae45db274ec240e IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.272681843456
0x1abe21411c8f0b73056b1bd05aa1f51d5a80ac31c7931063449749498887106aClaim Many From ...390933392022-05-26 10:22:555 hrs 9 mins ago0xfe3a593fb8a90185a8e31edc8eb02e7d889d52f0 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.041259615761
0x8a41e4f620f4453e3e9ddb134328954caf94d1246cc3f787705598ad444c77fdClaim Many From ...390921032022-05-26 9:57:275 hrs 34 mins ago0x37680d9a1b147b2280eba720d44e74afa6bdc292 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.017902485
0xf056610207bc72945bca1b2c84783dc62f7069042ccbe5985fcf83581b5b87feClaim Many From ...390918542022-05-26 9:52:535 hrs 39 mins ago0x1958b955e2d28fdfa58a4d97fe35a59a53b1d750 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.083897620948
0x88864f2191a35c1d956161910d1ddce34316864340f35cc0a5b61cc0c7a541a0Claim Many From ...390913412022-05-26 9:43:315 hrs 48 mins ago0xb1696abd28be2dba485f882f72bb820a42da74cc IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.633001267499
0x84f5c5ef5545cd7f782eb36d0121ff7746cd1a66c367bb69d322a6cbc138eac1Claim Many From ...390911522022-05-26 9:39:525 hrs 52 mins ago0xb1696abd28be2dba485f882f72bb820a42da74cc IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM1.207248012842
0x9e4ddcb380f4e97c91c08b201b05f87b20c87a8282e0def91e7f61a3394531aaAdd Many To Hide...390909992022-05-26 9:36:495 hrs 55 mins ago0x7ed9fa948c3ca998d62b4ff271435750666fa43f IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.955851683806
0x4583eb11c9f9f6f451f0a49a60793ce70f9616f785d78bdfa65ca11274bbde40Add Many To Hide...390895392022-05-26 9:08:186 hrs 23 mins ago0x38274785d72ed15af7c40685e4a54a60bbb14668 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.070562625574
0xd76d30453d091fcef1138f571f383dcbd9c33f4484d05c0e3ae65815ca6e33f2Add Many To Hide...390888532022-05-26 8:55:076 hrs 36 mins ago0x97e7320814444f5f5274d78b1ba1e2df5ec8680f IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.51650419175
0xea59838eac4f619bc9d9b58f085b28a5e8a21c2228b60eb5fea57ab4ccd2c3fcAdd Many To Hide...390843882022-05-26 7:23:388 hrs 8 mins ago0xc2e1512656f1c9e549dc7a57f6a8b1957afbda5b IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.15825729336
0xba979e36c852e354926970508c67f10095fe41813e85846d8ff0ef6a4cf0989fUnstake Many Fro...390823102022-05-26 6:40:278 hrs 51 mins ago0xed32eac95d8bd9b2d08cd67288d2fc4923e938c2 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.031151832973
0xc2f82ddb8c619ff8ce1797f6cc6f509c3a9e096e6337d30a816b7d0944baa52aAdd Many To Hide...390821472022-05-26 6:37:328 hrs 54 mins ago0x2f5b62b1fc025ac53690d339064ebc01b4a1f138 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.344249824032
0x326cea5b11f2b04e7482782b72830d663a608ace7ad80b72bf30b745187ccf78Add Many To Hide...390820142022-05-26 6:34:398 hrs 57 mins ago0x2f5b62b1fc025ac53690d339064ebc01b4a1f138 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.37943284331
0x9efa8e2985ca1d9267ef49056f2238ba6bbb1925077ab5b12dfe36a27ecaf95dClaim Many From ...390814872022-05-26 6:22:139 hrs 9 mins ago0x2f5b62b1fc025ac53690d339064ebc01b4a1f138 IN  0x2d22402a83f4416bf26e5e2fac10a053194f759d0 FTM0.194212622333
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x65f90b31822d8f56b490aeef5572ef346ea0d156f65ea1195389190d53a17c78382225382022-05-14 12:25:2612 days 3 hrs ago 0xbf71b365e6e59b31a846f75650cad97e14f554fa  Contract Creation0 FTM
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Hideout

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 15 : Hideout.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "./interfaces/IHnO.sol";
import "./interfaces/IGem.sol";
import "./interfaces/IHideout.sol";
import "./interfaces/ITemple.sol";
import "./interfaces/IRandomizer.sol";


contract Hideout is IHideout, Ownable, ReentrancyGuard, IERC721Receiver, Pausable {
  using EnumerableSet for EnumerableSet.UintSet;
  
  // maximum rank for a Hamster/Owl
  uint256 public constant MAX_RANK = 8; 

  // struct to store a stake's token, owner, and earning values
  struct Stake {
    uint256 tokenId;
    uint256 value;
    address owner;
  }

  struct UnstakeCommit {
    EnumerableSet.UintSet tokenIds;
    uint256 roundNumber;
    uint256 timestamp;
  }

  struct UnstakeCommitResponse {
    uint256[] tokenIds;
    uint256 roundNumber;
    uint256 timestamp;
  }

  uint256 private totalRankStaked;
  uint256 private numHamstersStaked;

  event TokenStaked(address indexed owner, uint256 indexed tokenId, bool indexed isHamster, uint256 value);
  event HamsterClaimed(uint256 indexed tokenId, bool indexed unstaked, uint256 earned, uint256 toOwls);
  event OwlClaimed(uint256 indexed tokenId, bool indexed unstaked, uint256 earned);
 
  // reference to the HnO NFT contract
  IHnO public hnoNFT;
  // reference to the HnO NFT contract
  address public hnoGame;
  // reference to the $GEM contract for minting $GEM earnings
  IGem public gemToken;
  // reference to Randomer 
  IRandomizer public randomizer;

  // maps tokenId to stake
  mapping(uint256 => Stake) private hideout; 
  // maps rank to all Owl staked with that rank
  mapping(uint256 => Stake[]) private flight; 
  // tracks location of each Owl in Flight
  mapping(uint256 => uint256) private flightIndices; 
  // account -> staked token ids
  mapping(address => EnumerableSet.UintSet) private _accountStakedTokenIds;
  // account -> claim commit
  mapping(address => UnstakeCommit) private unstakeCommits;
  // any rewards distributed when no owls are staked
  uint256 private unaccountedRewards = 0; 
  // amount of $GEM due for each rank point staked
  uint256 private gemPerRank = 0;

  // hamsters earn 25 $GEM per day
  uint256 public DAILY_GEM_RATE = 25 ether;
  // hamsters must have 2 days worth of $GEM to unstake or else they're still guarding the hideout
  uint256 public MINIMUM_TO_EXIT = 2 days;
  // owls take a 25% tax on all $GEM claimed
  uint256 public GEM_CLAIM_TAX_PERCENTAGE = 25;
  // there will only ever be (roughly) 2.4 billion $GEM earned through staking
  uint256 public MAXIMUM_GLOBAL_GEM = 9000000 ether;
  // limit value for unstake/reveal array length size
  uint256 public MAX_UNSTAKE_COUNT = 50;
  uint256 public treasureChestTypeId;

  // amount of $GEM earned so far
  uint256 public totalGEMEarned;
  // the last time $GEM was claimed
  uint256 private lastClaimTimestamp;

  // emergency rescue to allow unstaking without any checks but without $GEM
  bool public rescueEnabled = false;

  // update functions

  function updateDailyGemRate(uint256 dailyGemRate) external onlyOwner returns (bool) {
    DAILY_GEM_RATE = dailyGemRate;
    return true;
  }

  function updateMinimumToExit(uint256 minimumToExit) external onlyOwner returns (bool) {
    MINIMUM_TO_EXIT = minimumToExit;
    return true;
  }

  function updateGemClaimTaxPercentage(uint256 gemClaimTaxPercentage) external onlyOwner returns (bool) {
    GEM_CLAIM_TAX_PERCENTAGE = gemClaimTaxPercentage;
    return true;
  }

  function updateMaximumGlobalGem(uint256 maximumGlobalGem) external onlyOwner returns (bool) {
    MAXIMUM_GLOBAL_GEM = maximumGlobalGem;
    return true;
  }

  function updateMaxUnstakeCount(uint256 maxUnstakeCount) external onlyOwner returns (bool) {
    MAX_UNSTAKE_COUNT = maxUnstakeCount;
    return true;
  }

  // getters

  function accountStakedTokenIdsCount(address account) external view returns (uint256) {
    return _accountStakedTokenIds[account].length();
  }

  function accountStakedTokenId(address account, uint256 id) external view returns (uint256) {
    return _accountStakedTokenIds[account].at(id);
  }

  function accountStakedTokenIds(
    address account,
    uint256 offset,
    uint256 limit
  ) external view returns (uint256[] memory tokenIds) {
    EnumerableSet.UintSet storage set = _accountStakedTokenIds[account];
    uint256 setLength = set.length();
    uint256 to = offset + limit;
    if (setLength < to) to = setLength;
    tokenIds = new uint256[](to - offset);
    for (uint256 i = offset; i < to; i++) {
      tokenIds[i - offset] = set.at(setLength - i - 1);
    }
  }

  function stakeByTokenId(uint256 tokenId) external view returns (Stake memory) {
    if (hnoNFT.isHamster(tokenId)) return hideout[tokenId];
    uint256 arrayIndex = flightIndices[tokenId];
    uint256 rank = _rankForOwl(tokenId);
    return flight[rank][arrayIndex];
  }

  function getPendingUnstakeCommit(address account) external view returns (UnstakeCommitResponse memory) {
    UnstakeCommit storage unstakeCommit = unstakeCommits[account];
    require(unstakeCommit.roundNumber != 0, "no pending claims");
    uint256 unstakeCommitTokenIdsLength = unstakeCommit.tokenIds.length();
    uint256[] memory responseIds = new uint256[](unstakeCommitTokenIdsLength);
    for (uint256 i = 0; i < unstakeCommitTokenIdsLength; i++) responseIds[i] = unstakeCommit.tokenIds.at(i);
    return UnstakeCommitResponse(responseIds, unstakeCommit.roundNumber, unstakeCommit.timestamp);
  }

  function hasUnstakePending(address account) external view returns (bool) {
    return unstakeCommits[account].roundNumber != 0;
  }

  function canReveal(address account) external view returns (bool) {
    uint256 randomRound = unstakeCommits[account].roundNumber;
    return randomRound != 0 && randomizer.isRandomReady(randomRound);
  }

  constructor() {
    _pause();
  }

  /** CRITICAL TO SETUP */

  modifier requireContractsSet() {
    address zero = address(0);
    require(
      address(hnoNFT) != zero
      && address(gemToken) != zero
      && hnoGame != zero
      && address(randomizer) != zero,
      "Contracts not set"
    );
    _;
  }

  function setContracts(address _hnoNFT, address _gem, address _hnoGame, address _rand) external onlyOwner {
    address zero = address(0);
    require(_hnoNFT != zero, "NFT is zero address");
    require(_gem != zero, "Gem is zero address");
    require(_hnoGame != zero, "Game is zero address");
    require(_rand != zero, "Randomizer is zero address");
    hnoNFT = IHnO(_hnoNFT);
    gemToken = IGem(_gem);
    hnoGame = _hnoGame;
    randomizer = IRandomizer(_rand);
  }

  function setTreasureChestId(uint256 typeId) external onlyOwner {
    treasureChestTypeId = typeId;
  }

  /** STAKING */

  /**
   * adds Hamsters and Owls to the Hideout and Flight
   * @param account the address of the staker
   * @param tokenIds the IDs of the Hamsters and Owls to stake
   */
  function addManyToHideoutAndFlight(address account, uint256[] memory tokenIds) external override nonReentrant {
    address caller = _msgSender();
    address origin = tx.origin;
    address this_ = address(this);
    require(origin == caller || caller == hnoGame, "Only EOA");
    require(account == origin, "account to sender mismatch");
    for (uint256 i = 0; i < tokenIds.length; i++) {
      if (caller != hnoGame) { // dont do this step if its a mint + stake
        require(hnoNFT.ownerOf(tokenIds[i]) == caller, "You don't own this token");
        hnoNFT.transferFrom(caller, this_, tokenIds[i]);
      } else if (tokenIds[i] == 0) continue; // there may be gaps in the array for stolen tokens
      if (hnoNFT.isHamster(tokenIds[i])) _addHamsterToHideout(account, tokenIds[i]);
      else _addOwlToFlight(account, tokenIds[i]);
    }
  }

  /**
   * adds a single Hamster to the Hideout
   * @param account the address of the staker
   * @param tokenId the ID of the Hamster to add to the Hideout
   */
  function _addHamsterToHideout(address account, uint256 tokenId) internal whenNotPaused _updateEarnings {
    uint256 timestamp = block.timestamp;
    hideout[tokenId] = Stake({
      owner: account,
      tokenId: tokenId,
      value: timestamp
    });
    _accountStakedTokenIds[account].add(tokenId);
    numHamstersStaked += 1;
    emit TokenStaked(account, tokenId, true, timestamp);
  }

  /**
   * adds a single Owl to the Flight
   * @param account the address of the staker
   * @param tokenId the ID of the Owl to add to the Flight
   */
  function _addOwlToFlight(address account, uint256 tokenId) internal {
    uint256 rank = _rankForOwl(tokenId);
    totalRankStaked += rank; // Portion of earnings ranges from 8 to 5
    flightIndices[tokenId] = flight[rank].length; // Store the location of the owl in the Flight
    flight[rank].push(Stake({
      owner: account,
      tokenId: tokenId,
      value: gemPerRank
    })); // Add the owl to the Flight
    _accountStakedTokenIds[account].add(tokenId);
    emit TokenStaked(account, tokenId, false, gemPerRank);
  }

  /** CLAIMING / UNSTAKING */

  function claimManyFromHideoutAndFlight(
    uint256[] memory tokenIds
  ) external whenNotPaused _updateEarnings nonReentrant {
    uint256 timestamp = block.timestamp;
    address caller = _msgSender();
    require(tx.origin == caller || caller == hnoGame, "Only EOA");
    uint256 owed = 0;
    UnstakeCommit storage commit = unstakeCommits[caller];
    for (uint256 i = 0; i < tokenIds.length; i++) {
      uint256 tokenId = tokenIds[i];
      require(!commit.tokenIds.contains(tokenId), "Can't claim token id from unstake commit");
      if (hnoNFT.isHamster(tokenId)) owed += _claimHamsterFromHideout(tokenId, timestamp);
      else owed += _claimOwlFromFlight(tokenId);
    }
    gemToken.updateOriginAccess();
    if (owed == 0) return;
    gemToken.mint(caller, owed);
  }

  /**
   * realize $GEM earnings and optionally unstake tokens from the Hideout / Flight
   * to unstake a Hamster it will require it has 2 days worth of $GEM unclaimed
   * @param tokenIds the IDs of the tokens to claim earnings from
   */
  function unstakeManyFromHideoutAndFlight(
    uint256[] memory tokenIds
  ) external whenNotPaused _updateEarnings nonReentrant {
    uint256 timestamp = block.timestamp;
    address caller = _msgSender();
    require(tx.origin == caller || caller == hnoGame, "Only EOA");
    uint256 tokenIdsLength = tokenIds.length;
    require(tokenIdsLength <= MAX_UNSTAKE_COUNT, "Hideout: TokenIds count gt max unstake count");
    uint256 owed = 0;
    UnstakeCommit storage commit = unstakeCommits[caller];
    bool isHamsterInTokens = false;
    for (uint256 i = 0; i < tokenIdsLength; i++) {
      uint256 tokenId = tokenIds[i];
      if (hnoNFT.isHamster(tokenId)) {
        Stake memory stake = hideout[tokenId];
        require(!(timestamp - stake.value < MINIMUM_TO_EXIT), "Still guarding the hideout");
        isHamsterInTokens = true;
        numHamstersStaked -= 1;
        commit.tokenIds.add(tokenId);
      }
      else owed += _unstakeOwlFromFlight(tokenId);
    }
    if (commit.tokenIds.length() > 0 && isHamsterInTokens) {
      require(commit.roundNumber == 0, "Hideout: Commit already exists");
      if (!randomizer.nextRoundRequired()) randomizer.requireNextRound();
      commit.roundNumber = randomizer.nextRound();
      commit.timestamp = timestamp;
    }
    gemToken.updateOriginAccess();
    if (owed == 0) return;
    gemToken.mint(caller, owed);
  }

  function unstakeRevealHamsterFromHideout(uint256[] memory tokenIds) external {
    address caller = _msgSender();
    require(tx.origin == caller || caller == hnoGame, "Only EOA");
    uint256 tokenIdsLength = tokenIds.length;
    require(tokenIdsLength > 0 && tokenIdsLength <= MAX_UNSTAKE_COUNT, "Hideout: Invalid tokenIds length");
    UnstakeCommit storage commit = unstakeCommits[caller];
    require(randomizer.isRandomReady(commit.roundNumber), "Hideout: Unstake reveal random not ready");
    uint256 seed = randomizer.random(commit.roundNumber);
    uint256 owed = 0;
    for (uint256 i = 0; i < tokenIdsLength; i++) {
      uint256 tokenId = tokenIds[i];
      require(commit.tokenIds.contains(tokenId), "Hideout: Token id not in unstake commit");
      seed = uint256(keccak256(abi.encode(seed, caller)));
      owed += _unstakeHamsterFromHideout(tokenId, commit.timestamp, seed & 1 == 1);
      commit.tokenIds.remove(tokenId);
    }
    if (commit.tokenIds.length() == 0) delete unstakeCommits[caller];
    gemToken.updateOriginAccess();
    if (owed == 0) return;
    gemToken.mint(caller, owed);
  }

  function calculateRewards(uint256 tokenId) external view returns (uint256 owed) {
    uint256 lastTokenWrite = hnoNFT.getTokenWriteBlock(tokenId);
    // Must check this, as getTokenTraits will be allowed since this contract is an admin
    require(lastTokenWrite < block.number, "hmmmm what doing?");
    Stake memory stake = hideout[tokenId];
    if (hnoNFT.isHamster(tokenId)) {
      UnstakeCommit storage commit = unstakeCommits[stake.owner];
      uint256 timestamp = commit.tokenIds.contains(tokenId) ? commit.timestamp : block.timestamp;
      if (totalGEMEarned < MAXIMUM_GLOBAL_GEM) owed = (timestamp - stake.value) * DAILY_GEM_RATE / 1 days;
      else if (stake.value > lastClaimTimestamp) owed = 0; // $GEM production stopped already
      else owed = (lastClaimTimestamp - stake.value) * DAILY_GEM_RATE / 1 days; 
      // stop earning additional $GEM if it's all been earned
    }
    else {
      uint256 rank = _rankForOwl(tokenId);
      owed = (rank) * (gemPerRank - stake.value); // Calculate portion of tokens based on Rank
    }
  }

  /**
   * realize $GEM earnings for a single Hamster and optionally unstake it
   * if not unstaking, pay a 20% tax to the staked Owls
   * if unstaking, there is a 50% chance all $GEM is stolen
   * @param tokenId the ID of the Hamsters to claim earnings from
   * @return owed - the amount of $GEM earned
   */
  function _claimHamsterFromHideout(
    uint256 tokenId,
    uint256 timestamp
  ) internal returns (uint256 owed) {
    address caller = _msgSender();
    Stake memory stake = hideout[tokenId];
    require(stake.owner == caller, "Don't own the given token");
    if (totalGEMEarned < MAXIMUM_GLOBAL_GEM) owed = (timestamp - stake.value) * DAILY_GEM_RATE / 1 days;
    else if (stake.value > lastClaimTimestamp) owed = 0; // $GEM production stopped already
    else owed = (lastClaimTimestamp - stake.value) * DAILY_GEM_RATE / 1 days;
    // stop earning additional $GEM if it's all been earned
    uint256 toOwls = owed * GEM_CLAIM_TAX_PERCENTAGE / 100;
    _payOwlTax(toOwls); // percentage tax to staked owls
    owed = owed * (100 - GEM_CLAIM_TAX_PERCENTAGE) / 100; // remainder goes to Hamster owner
    hideout[tokenId] = Stake({
      owner: caller,
      tokenId: tokenId,
      value: block.timestamp
    }); // reset stake
    emit HamsterClaimed(tokenId, false, owed, toOwls);
  }

  function _unstakeHamsterFromHideout(
    uint256 tokenId,
    uint256 timestamp,
    bool isStolen
  ) internal returns (uint256 owed) {
    uint256 toOwls;
    address caller = _msgSender();
    Stake memory stake = hideout[tokenId];
    require(stake.owner == caller, "Don't own the given token");
    if (totalGEMEarned < MAXIMUM_GLOBAL_GEM) owed = (timestamp - stake.value) * DAILY_GEM_RATE / 1 days;
    else if (stake.value > lastClaimTimestamp) owed = 0; // $GEM production stopped already
    else owed = (lastClaimTimestamp - stake.value) * DAILY_GEM_RATE / 1 days;
    // stop earning additional $GEM if it's all been earned
    if (isStolen) { // 50% chance of all $GEM stolen
      toOwls = owed;
      _payOwlTax(toOwls);
      owed = 0;
    }
    delete hideout[tokenId];
    _accountStakedTokenIds[caller].remove(tokenId);
    // Always transfer last to guard against reentrance
    hnoNFT.safeTransferFrom(address(this), caller, tokenId, ""); // send back Hamster
    emit HamsterClaimed(tokenId, true, owed, toOwls);
  }

  /**
   * realize $GEM earnings for a single Owl and optionally unstake it
   * Owls earn $GEM proportional to their rank
   * @param tokenId the ID of the Owl to claim earnings from
   * @return owed - the amount of $GEM earned
   */
  function _claimOwlFromFlight(uint256 tokenId) internal returns (uint256 owed) {
    address caller = _msgSender();
    require(hnoNFT.ownerOf(tokenId) == address(this), "Doesn't own token");
    uint256 rank = _rankForOwl(tokenId);
    Stake memory stake = flight[rank][flightIndices[tokenId]];
    require(stake.owner == caller, "Doesn't own token");
    owed = (rank) * (gemPerRank - stake.value); // Calculate portion of tokens based on Rank
    flight[rank][flightIndices[tokenId]] = Stake({
      owner: caller,
      tokenId: tokenId,
      value: gemPerRank
    }); // reset stake
    emit OwlClaimed(tokenId, false, owed);
  }

  function _unstakeOwlFromFlight(uint256 tokenId) internal returns (uint256 owed) {
    address caller = _msgSender();
    require(hnoNFT.ownerOf(tokenId) == address(this), "Doesn't own token");
    uint256 rank = _rankForOwl(tokenId);
    Stake memory stake = flight[rank][flightIndices[tokenId]];
    require(stake.owner == caller, "Doesn't own token");
    owed = (rank) * (gemPerRank - stake.value); // Calculate portion of tokens based on Rank
    totalRankStaked -= rank; // Remove rank from total staked
    Stake memory lastStake = flight[rank][flight[rank].length - 1];
    flight[rank][flightIndices[tokenId]] = lastStake; // Shuffle last Owl to current position
    flightIndices[lastStake.tokenId] = flightIndices[tokenId];
    flight[rank].pop(); // Remove duplicate
    delete flightIndices[tokenId]; // Delete old mapping
    _accountStakedTokenIds[caller].remove(tokenId);
    // Always remove last to guard against reentrance
    hnoNFT.safeTransferFrom(address(this), caller, tokenId, ""); // Send back Owl
    emit OwlClaimed(tokenId, true, owed);
  }
  /**
   * emergency unstake tokens
   * @param tokenIds the IDs of the tokens to claim earnings from
   */
  function rescue(uint256[] memory tokenIds) external nonReentrant {
    address caller = _msgSender();
    address this_ = address(this);
    require(rescueEnabled, "RESCUE DISABLED");
    uint256 tokenIdsLength = tokenIds.length;
    require(tokenIdsLength < MAX_UNSTAKE_COUNT, "Hideout: Invalid tokenIds length");
    UnstakeCommit storage commit = unstakeCommits[caller];
    uint256 tokenId;
    Stake memory stake;
    Stake memory lastStake;
    uint256 rank;
    for (uint256 i = 0; i < tokenIdsLength; i++) {
      tokenId = tokenIds[i];
      if (hnoNFT.isHamster(tokenId)) {
        stake = hideout[tokenId];
        require(stake.owner == caller, "SWIPER, NO SWIPING");
        delete hideout[tokenId];
        numHamstersStaked -= 1;
        hnoNFT.safeTransferFrom(this_, caller, tokenId, ""); // send back Hamsters
        emit HamsterClaimed(tokenId, true, 0, 0);
      } else {
        rank = _rankForOwl(tokenId);
        stake = flight[rank][flightIndices[tokenId]];
        require(stake.owner == caller, "SWIPER, NO SWIPING");
        totalRankStaked -= rank; // Remove Rank from total staked
        lastStake = flight[rank][flight[rank].length - 1];
        flight[rank][flightIndices[tokenId]] = lastStake; // Shuffle last Owl to current position
        flightIndices[lastStake.tokenId] = flightIndices[tokenId];
        flight[rank].pop(); // Remove duplicate
        delete flightIndices[tokenId]; // Delete old mapping
        hnoNFT.safeTransferFrom(this_, caller, tokenId, ""); // Send back Owl
        emit OwlClaimed(tokenId, true, 0);
      }
      if (commit.tokenIds.contains(tokenId)) commit.tokenIds.remove(tokenId);
    }
    if (commit.tokenIds.length() == 0) delete unstakeCommits[caller];
  }

  /** ACCOUNTING */

  /** 
   * add $GEM to claimable pot for the Flight
   * @param amount $GEM to add to the pot
   */
  function _payOwlTax(uint256 amount) internal {
    if (totalRankStaked == 0) { // if there's no staked owls
      unaccountedRewards += amount; // keep track of $GEM due to owls
      return;
    }
    // makes sure to include any unaccounted $GEM 
    gemPerRank += (amount + unaccountedRewards) / totalRankStaked;
    unaccountedRewards = 0;
  }

  /**
   * tracks $GEM earnings to ensure it stops once 2.4 billion is eclipsed
   */
  modifier _updateEarnings() {
    if (totalGEMEarned < MAXIMUM_GLOBAL_GEM) {
      totalGEMEarned += 
        (block.timestamp - lastClaimTimestamp)
        * numHamstersStaked
        * DAILY_GEM_RATE / 1 days; 
      lastClaimTimestamp = block.timestamp;
    }
    _;
  }

  /** ADMIN */

  /**
   * allows owner to enable "rescue mode"
   * simplifies accounting, prioritizes tokens out in emergency
   */
  function setRescueEnabled(bool _enabled) external onlyOwner {
    rescueEnabled = _enabled;
  }

  /**
   * enables owner to pause / unpause contract
   */
  function setPaused(bool _paused) external requireContractsSet onlyOwner {
    if (_paused) _pause();
    else _unpause();
  }

  /** READ ONLY */

  /**
   * gets the rank score for a Owl
   * @param tokenId the ID of the Owl to get the rank score for
   * @return the rank score of the Owl (5-8)
   */
  function _rankForOwl(uint256 tokenId) internal view returns (uint256) {
    IHnO.HamsterOwl memory s = hnoNFT.getTokenTraits(tokenId);
    return MAX_RANK - s.rankIndex; // rank index is 0-3
  }

  /**
   * chooses a random Owl thief when a newly minted token is stolen
   * @param seed a random value to choose a Owl from
   * @return the owner of the randomly selected Owl thief
   */
  function randomOwlOwner(uint256 seed) external view override returns (address, uint256) {
    address zeroAddress = address(0);
    uint256 zero = 0;
    if (totalRankStaked == 0) return (zeroAddress, zero);
    uint256 bucket = (seed & 0xFFFFFFFF) % totalRankStaked; // choose a value from 0 to total rank staked
    uint256 cumulative;
    seed >>= 32;
    // loop through each bucket of Owls with the same rank score
    for (uint256 i = MAX_RANK - 3; i <= MAX_RANK; i++) {
      cumulative += flight[i].length * i;
      // if the value is not inside of that bucket, keep going
      if (bucket >= cumulative) continue;
      // get the address of a random Owl with that rank score
      Stake storage stake_ = flight[i][seed % flight[i].length];
      return (stake_.owner, stake_.tokenId);
    }
    return (zeroAddress, zero);
  }

  function onERC721Received(
    address,
    address from,
    uint256,
    bytes calldata
  ) external pure override returns (bytes4) {
    require(from == address(0), "Cannot send to Hideout directly");
    return IERC721Receiver.onERC721Received.selector;
  }
}

File 2 of 15 : ITemple.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;


interface ITemple {
    function mint(uint256 typeId, uint256 qty, address recipient) external;
    function burn(uint256 typeId, uint256 qty, address burnFrom) external;
    function updateOriginAccess() external;
    function balanceOf(address account, uint256 id) external returns (uint256);
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes memory data) external;
}

File 3 of 15 : IRandomizer.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;


interface IRandomizer {
  enum Status {
    NOT_ACTIVE,
    ACTIVE,
    FINISHED,
    RELEASED
  }

  struct Round {
    uint256 startAt;
    uint256 endsAt;
    bytes32 hashSeed;
    string seed;
    uint256 blockNumber;
    bytes32 blockHash;
    uint256 random;
    Status status;
  }

  function canFinishRound() external view returns (bool);
  function currentRound() external view returns (uint256);
  function delay() external view returns (uint256);
  function nextRound() external view returns (uint256);
  function nextRoundRequired() external view returns (bool);
  function roundMinDuration() external view returns (uint256);
  function canFinishRound(uint256 roundNumber_) external view returns (bool);
  function isRandomReady(uint256 roundNumber_) external view returns (bool);
  function random(uint256 roundNumber_) external view returns (uint256);
  function round(uint256 roundNumber_) external view returns (Round memory);

  function requireNextRound() external returns (bool);

  event BlockHashSaved(uint256 round_, bytes32 blockHash_, address indexed caller);
  event DelayUpdated(uint256 delay_);
  event RandomReleased(
    uint256 round_,
    uint256 random_,
    address indexed caller
  );
  event RoundMinDurationUpdated(uint256 roundMinDuration_);
  event RoundFinished(uint256 round_, string seed_, address indexed caller);
  event RoundRequired(uint256 round_);
  event RoundRestarted(uint256 indexed round_, bytes32 hashSeed_, uint256 blockNumber_, address indexed caller);
  event RoundStarted(uint256 round_, bytes32 hashSeed_, uint256 blockNumber_, address indexed caller);
}

File 4 of 15 : IHnO.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";


interface IHnO is IERC721Enumerable {
    struct HamsterOwl {
        bool isHamster;
        uint256 body;
        uint256 head;
        uint256 spell;
        uint256 eyes;
        uint256 neck;
        uint256 mouth;
        uint256 wand;
        uint256 tail;
        uint256 rankIndex;
    }

    function minted() external view returns (uint256);
    function updateOriginAccess(uint256[] memory tokenIds) external;
    function mint(address recipient, uint256 seed, bool savedByChest, uint256 stolenById) external;
    function burn(uint256 tokenId) external;
    function getMaxTokens() external view returns (uint256);
    function getPaidTokens() external view returns (uint256);
    function getTokenTraits(uint256 tokenId) external view returns (HamsterOwl memory);
    function getTokenWriteBlock(uint256 tokenId) external view returns(uint256);
    function isHamster(uint256 tokenId) external view returns(bool);
}

File 5 of 15 : IHideout.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;


interface IHideout {
  function addManyToHideoutAndFlight(address account, uint256[] memory tokenIds) external;
  function randomOwlOwner(uint256 seed) external view returns (address, uint256);
}

File 6 of 15 : IGem.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;


interface IGem {
    function mint(address to, uint256 amount) external;
    function burn(address from, uint256 amount) external;
    function updateOriginAccess() external;
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

        assembly {
            result := store
        }

        return result;
    }
}

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

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

File 10 of 15 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 13 of 15 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 14 of 15 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 15 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"bool","name":"unstaked","type":"bool"},{"indexed":false,"internalType":"uint256","name":"earned","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toOwls","type":"uint256"}],"name":"HamsterClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"bool","name":"unstaked","type":"bool"},{"indexed":false,"internalType":"uint256","name":"earned","type":"uint256"}],"name":"OwlClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"bool","name":"isHamster","type":"bool"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TokenStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DAILY_GEM_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GEM_CLAIM_TAX_PERCENTAGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_GLOBAL_GEM","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_RANK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_UNSTAKE_COUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_TO_EXIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"accountStakedTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"accountStakedTokenIds","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"accountStakedTokenIdsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"addManyToHideoutAndFlight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"calculateRewards","outputs":[{"internalType":"uint256","name":"owed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"canReveal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claimManyFromHideoutAndFlight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gemToken","outputs":[{"internalType":"contract IGem","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getPendingUnstakeCommit","outputs":[{"components":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256","name":"roundNumber","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"internalType":"struct Hideout.UnstakeCommitResponse","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"hasUnstakePending","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hnoGame","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hnoNFT","outputs":[{"internalType":"contract IHnO","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"seed","type":"uint256"}],"name":"randomOwlOwner","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomizer","outputs":[{"internalType":"contract IRandomizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"rescue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rescueEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_hnoNFT","type":"address"},{"internalType":"address","name":"_gem","type":"address"},{"internalType":"address","name":"_hnoGame","type":"address"},{"internalType":"address","name":"_rand","type":"address"}],"name":"setContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setRescueEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"typeId","type":"uint256"}],"name":"setTreasureChestId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stakeByTokenId","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"internalType":"struct Hideout.Stake","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalGEMEarned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasureChestTypeId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unstakeManyFromHideoutAndFlight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unstakeRevealHamsterFromHideout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"dailyGemRate","type":"uint256"}],"name":"updateDailyGemRate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"gemClaimTaxPercentage","type":"uint256"}],"name":"updateGemClaimTaxPercentage","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxUnstakeCount","type":"uint256"}],"name":"updateMaxUnstakeCount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maximumGlobalGem","type":"uint256"}],"name":"updateMaximumGlobalGem","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minimumToExit","type":"uint256"}],"name":"updateMinimumToExit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

60806040526000600e819055600f5568015af1d78b58c400006010556202a30060115560196012556a0771d2fa45345aa900000060135560326014556018805460ff191690553480156200005257600080fd5b506200005e336200007c565b600180556002805460ff1916905562000076620000cc565b6200016a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60025460ff1615620001175760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640160405180910390fd5b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586200014d3390565b6040516001600160a01b03909116815260200160405180910390a1565b615725806200017a6000396000f3fe608060405234801561001057600080fd5b50600436106102d35760003560e01c8063949c513e11610186578063cc241786116100e3578063e629b6c311610097578063f2fde38b11610071578063f2fde38b14610667578063f766ec1e1461067a578063ff2fb57c146106b957600080fd5b8063e629b6c3146105f3578063e74c6bb51461063e578063f10fb5841461064757600080fd5b8063dda4c63d116100c8578063dda4c63d146105c4578063de170ed2146105cd578063e1959296146105e057600080fd5b8063cc2417861461059e578063d3ea4350146105b157600080fd5b8063bf989b6e1161013a578063c81dc25c1161011f578063c81dc25c14610562578063cbc09fc614610575578063cbce52bb1461057e57600080fd5b8063bf989b6e1461053c578063c36ce2f81461054f57600080fd5b80639eea34f81161016b5780639eea34f8146104db578063a4736c0d146104ee578063a5d442061461052957600080fd5b8063949c513e146104c05780639e3bcb8d146104d357600080fd5b80634d0053ce116102345780636e080d1f116101e857806376531008116101cd578063765310081461047c5780638da5cb5b1461048f578063936315d6146104ad57600080fd5b80636e080d1f14610454578063715018a61461047457600080fd5b80635335015d116102195780635335015d146104235780635c975abb146104365780636a3ef0571461044157600080fd5b80634d0053ce146103f057806350fc0af01461041057600080fd5b806329ceaaef1161028b57806339db714f1161027057806339db714f146103b757806340d6872c146103d4578063454178be146103dd57600080fd5b806329ceaaef1461036957806337a386b9146103ae57600080fd5b8063150b7a02116102bc578063150b7a02146102fd57806316c38b3c146103415780631f4fb37a1461035657600080fd5b8063031cd06f146102d857806305fd4faf146102f4575b600080fd5b6102e160145481565b6040519081526020015b60405180910390f35b6102e160165481565b61031061030b366004615074565b6106d9565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016102eb565b61035461034f366004615121565b610789565b005b61035461036436600461513e565b61091d565b6005546103899073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102eb565b6102e160115481565b6018546103c49060ff1681565b60405190151581526020016102eb565b6102e160125481565b6103c46103eb36600461513e565b6109a3565b6006546103899073ffffffffffffffffffffffffffffffffffffffff1681565b6103c461041e36600461513e565b610a33565b610354610431366004615269565b610abe565b60025460ff166103c4565b61035461044f366004615269565b610f7b565b6104676104623660046152a6565b61180c565b6040516102eb91906152db565b610354611913565b61035461048a366004615121565b6119a0565b60005473ffffffffffffffffffffffffffffffffffffffff16610389565b6103c46104bb36600461531f565b611a52565b6102e16104ce36600461533c565b611b1f565b6102e1600881565b6102e16104e936600461531f565b611b57565b6103c46104fc36600461531f565b73ffffffffffffffffffffffffffffffffffffffff166000908152600d6020526040902060020154151590565b6103c461053736600461513e565b611b85565b61035461054a366004615368565b611c10565b61035461055d366004615269565b611f48565b610354610570366004615269565b612727565b6102e160105481565b61059161058c36600461531f565b612cd2565b6040516102eb91906153c4565b6103c46105ac36600461513e565b612e4c565b6102e16105bf36600461513e565b612ed7565b6102e160135481565b6103546105db36600461542a565b6131ac565b6103c46105ee36600461513e565b613696565b61060661060136600461513e565b613721565b6040805182518152602080840151908201529181015173ffffffffffffffffffffffffffffffffffffffff16908201526060016102eb565b6102e160155481565b6008546103899073ffffffffffffffffffffffffffffffffffffffff1681565b61035461067536600461531f565b6138d7565b61068d61068836600461513e565b613a07565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016102eb565b6007546103899073ffffffffffffffffffffffffffffffffffffffff1681565b600073ffffffffffffffffffffffffffffffffffffffff85161561075e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f43616e6e6f742073656e6420746f20486964656f7574206469726563746c790060448201526064015b60405180910390fd5b507f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b60055460009073ffffffffffffffffffffffffffffffffffffffff16158015906107ce575060075473ffffffffffffffffffffffffffffffffffffffff828116911614155b80156107f5575060065473ffffffffffffffffffffffffffffffffffffffff828116911614155b801561081c575060085473ffffffffffffffffffffffffffffffffffffffff828116911614155b610882576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f436f6e747261637473206e6f74207365740000000000000000000000000000006044820152606401610755565b60005473ffffffffffffffffffffffffffffffffffffffff163314610903576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b811561091557610911613b15565b5050565b610911613bff565b60005473ffffffffffffffffffffffffffffffffffffffff16331461099e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b601555565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610a25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b50601081905560015b919050565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610ab5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b50601355600190565b60025460ff1615610b2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610755565b6013546016541015610b88576201518060105460045460175442610b4f91906154a9565b610b5991906154c0565b610b6391906154c0565b610b6d919061552c565b60166000828254610b7e9190615540565b9091555050426017555b60026001541415610bf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610755565b6002600155423332811480610c24575060065473ffffffffffffffffffffffffffffffffffffffff8281169116145b610c8a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f4f6e6c7920454f410000000000000000000000000000000000000000000000006044820152606401610755565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600d60205260408120815b8551811015610e4e576000868281518110610cce57610cce615558565b60209081029190910101519050610ce58382613cba565b15610d72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f43616e277420636c61696d20746f6b656e2069642066726f6d20756e7374616b60448201527f6520636f6d6d69740000000000000000000000000000000000000000000000006064820152608401610755565b6005546040517f8b3645150000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff90911690638b36451590602401602060405180830381865afa158015610de1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e059190615592565b15610e2557610e148187613cd2565b610e1e9085615540565b9350610e3b565b610e2e81613f1b565b610e389085615540565b93505b5080610e46816155af565b915050610cb1565b50600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c47ee3b6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610eb957600080fd5b505af1158015610ecd573d6000803e3d6000fd5b505050508160001415610ee35750505050610f74565b6007546040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff858116600483015260248201859052909116906340c10f1990604401600060405180830381600087803b158015610f5757600080fd5b505af1158015610f6b573d6000803e3d6000fd5b50505050505050505b5060018055565b60026001541415610fe8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610755565b60026001556018543390309060ff1661105d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5245534355452044495341424c454400000000000000000000000000000000006044820152606401610755565b825160145481106110ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f486964656f75743a20496e76616c696420746f6b656e496473206c656e6774686044820152606401610755565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600d602090815260408083208151606080820184528582528185018690528184018690528351908101845285815293840185905291830184905292916000805b868110156117a55789818151811061114057611140615558565b60209081029190910101516005546040517f8b3645150000000000000000000000000000000000000000000000000000000081526004810183905291965073ffffffffffffffffffffffffffffffffffffffff1690638b36451590602401602060405180830381865afa1580156111bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111df9190615592565b156113dd576000858152600960209081526040918290208251606081018452815481526001820154928101929092526002015473ffffffffffffffffffffffffffffffffffffffff9081169282018390529095508a161461129c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f5357495045522c204e4f2053574950494e4700000000000000000000000000006044820152606401610755565b60008581526009602052604081208181556001808201839055600290910180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905560048054919290916112f39084906154a9565b90915550506005546040517fb88d4fde00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a811660048301528b811660248301526044820188905260806064830152600060848301529091169063b88d4fde9060a401600060405180830381600087803b15801561138257600080fd5b505af1158015611396573d6000803e3d6000fd5b50506040805160008082526020820152600193508892507f7fff0263d8628d4ea53d366f5212365f19b220057d780c47ea6a2a1d88009c27910160405180910390a3611778565b6113e68561425d565b6000818152600a60209081526040808320898452600b9092529091205481549294509091811061141857611418615558565b60009182526020918290206040805160608101825260039093029091018054835260018101549383019390935260029092015473ffffffffffffffffffffffffffffffffffffffff9081169282018390529095508a16146114d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f5357495045522c204e4f2053574950494e4700000000000000000000000000006044820152606401610755565b81600360008282546114e791906154a9565b90915550506000828152600a602052604090208054611508906001906154a9565b8154811061151857611518615558565b60009182526020808320604080516060810182526003909402909101805484526001810154848401526002015473ffffffffffffffffffffffffffffffffffffffff1683820152858452600a8252808420898552600b909252909220548254919550859291811061158b5761158b615558565b60009182526020808320845160039390930201918255838101516001830155604093840151600290920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90931692909217909155878252600b8152828220548651835283832055848252600a905220805480611622576116226155e8565b6000828152602080822060037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94909401938402018281556001810183905560020180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905591909255868252600b9052604080822082905560055490517fb88d4fde00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b811660048301528c811660248301526044820189905260806064830152608482019390935291169063b88d4fde9060a401600060405180830381600087803b15801561172657600080fd5b505af115801561173a573d6000803e3d6000fd5b505060405160008152600192508791507fc551c58339a72b80275245a1929922436a305c9db411049144564e959612f1fe9060200160405180910390a35b6117828686613cba565b1561179357611791868661430a565b505b8061179d816155af565b915050611126565b506117af85614316565b610f6b5773ffffffffffffffffffffffffffffffffffffffff88166000908152600d6020526040812090818181816117e78282615020565b5050505060028201600090556003820160009055505050506001805550505050505050565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600c6020526040812060609161183d82614316565b9050600061184b8587615540565b9050808210156118585750805b61186286826154a9565b67ffffffffffffffff81111561187a5761187a615157565b6040519080825280602002602001820160405280156118a3578160200160208202803683370190505b509350855b81811015611908576118d060016118bf83866154a9565b6118c991906154a9565b8590614320565b856118db89846154a9565b815181106118eb576118eb615558565b602090810291909101015280611900816155af565b9150506118a8565b505050509392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611994576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b61199e600061432c565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314611a21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b601880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600d60205260408120600201548015801590611b1857506008546040517ff03021070000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff9091169063f030210790602401602060405180830381865afa158015611af4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b189190615592565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600c60205260408120611b4e9083614320565b90505b92915050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600c60205260408120611b5190614316565b6000805473ffffffffffffffffffffffffffffffffffffffff163314611c07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b50601155600190565b60005473ffffffffffffffffffffffffffffffffffffffff163314611c91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b600073ffffffffffffffffffffffffffffffffffffffff8516611d10576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4e4654206973207a65726f2061646472657373000000000000000000000000006044820152606401610755565b8073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611da6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f47656d206973207a65726f2061646472657373000000000000000000000000006044820152606401610755565b8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f47616d65206973207a65726f20616464726573730000000000000000000000006044820152606401610755565b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ed2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f52616e646f6d697a6572206973207a65726f20616464726573730000000000006044820152606401610755565b506005805473ffffffffffffffffffffffffffffffffffffffff9586167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556007805494861694821694909417909355600680549285169284169290921790915560088054919093169116179055565b60025460ff1615611fb5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610755565b6013546016541015612012576201518060105460045460175442611fd991906154a9565b611fe391906154c0565b611fed91906154c0565b611ff7919061552c565b601660008282546120089190615540565b9091555050426017555b6002600154141561207f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610755565b60026001554233328114806120ae575060065473ffffffffffffffffffffffffffffffffffffffff8281169116145b612114576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f4f6e6c7920454f410000000000000000000000000000000000000000000000006044820152606401610755565b82516014548111156121a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f486964656f75743a20546f6b656e49647320636f756e74206774206d6178207560448201527f6e7374616b6520636f756e7400000000000000000000000000000000000000006064820152608401610755565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600d6020526040812081805b848110156123a95760008882815181106121ec576121ec615558565b60209081029190910101516005546040517f8b3645150000000000000000000000000000000000000000000000000000000081526004810183905291925073ffffffffffffffffffffffffffffffffffffffff1690638b36451590602401602060405180830381865afa158015612267573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228b9190615592565b1561238057600081815260096020908152604091829020825160608101845281548152600182015492810183905260029091015473ffffffffffffffffffffffffffffffffffffffff1692810192909252601154906122ea908b6154a9565b1015612352576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5374696c6c206775617264696e672074686520686964656f75740000000000006044820152606401610755565b6001935060016004600082825461236991906154a9565b90915550612379905085836143a1565b5050612396565b612389816143ad565b6123939086615540565b94505b50806123a1816155af565b9150506121d0565b5060006123b583614316565b1180156123bf5750805b156125f857600282015415612430576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f486964656f75743a20436f6d6d697420616c72656164792065786973747300006044820152606401610755565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d1cfa996040518163ffffffff1660e01b8152600401602060405180830381865afa15801561249d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c19190615592565b61255a57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632002f7426040518163ffffffff1660e01b81526004016020604051808303816000875af1158015612534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125589190615592565b505b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166347e405536040518163ffffffff1660e01b8152600401602060405180830381865afa1580156125c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125eb9190615617565b6002830155600382018690555b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c47ee3b6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561266257600080fd5b505af1158015612676573d6000803e3d6000fd5b50505050826000141561268e57505050505050610f74565b6007546040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff878116600483015260248201869052909116906340c10f1990604401600060405180830381600087803b15801561270257600080fd5b505af1158015612716573d6000803e3d6000fd5b505050505050505050505060018055565b3332811480612750575060065473ffffffffffffffffffffffffffffffffffffffff8281169116145b6127b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f4f6e6c7920454f410000000000000000000000000000000000000000000000006044820152606401610755565b815180158015906127c957506014548111155b61282f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f486964656f75743a20496e76616c696420746f6b656e496473206c656e6774686044820152606401610755565b73ffffffffffffffffffffffffffffffffffffffff8281166000908152600d602052604090819020600854600282015492517ff030210700000000000000000000000000000000000000000000000000000000815260048101939093529092169063f030210790602401602060405180830381865afa1580156128b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128da9190615592565b612966576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f486964656f75743a20556e7374616b652072657665616c2072616e646f6d206e60448201527f6f742072656164790000000000000000000000000000000000000000000000006064820152608401610755565b60085460028201546040517fb863bd37000000000000000000000000000000000000000000000000000000008152600481019190915260009173ffffffffffffffffffffffffffffffffffffffff169063b863bd3790602401602060405180830381865afa1580156129dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a009190615617565b90506000805b84811015612b52576000878281518110612a2257612a22615558565b60209081029190910101519050612a398582613cba565b612ac5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f486964656f75743a20546f6b656e206964206e6f7420696e20756e7374616b6560448201527f20636f6d6d6974000000000000000000000000000000000000000000000000006064820152608401610755565b8387604051602001612af792919091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b6040516020818303038152906040528051906020012060001c9350612b27818660030154866001166001146148b3565b612b319084615540565b9250612b3d858261430a565b50508080612b4a906155af565b915050612a06565b50612b5c83614316565b612bab5773ffffffffffffffffffffffffffffffffffffffff85166000908152600d602052604081209081818181612b948282615020565b505050506002820160009055600382016000905550505b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c47ee3b6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612c1557600080fd5b505af1158015612c29573d6000803e3d6000fd5b505050508060001415612c3e57505050505050565b6007546040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff878116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b158015612cb257600080fd5b505af1158015612cc6573d6000803e3d6000fd5b50505050505050505050565b612cf660405180606001604052806060815260200160008152602001600081525090565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600d602052604090206002810154612d86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e6f2070656e64696e6720636c61696d730000000000000000000000000000006044820152606401610755565b6000612d9182614316565b905060008167ffffffffffffffff811115612dae57612dae615157565b604051908082528060200260200182016040528015612dd7578160200160208202803683370190505b50905060005b82811015612e1e57612def8482614320565b828281518110612e0157612e01615558565b602090810291909101015280612e16816155af565b915050612ddd565b5060405180606001604052808281526020018460020154815260200184600301548152509350505050919050565b6000805473ffffffffffffffffffffffffffffffffffffffff163314612ece576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b50601455600190565b6005546040517febd1736800000000000000000000000000000000000000000000000000000000815260048101839052600091829173ffffffffffffffffffffffffffffffffffffffff9091169063ebd1736890602401602060405180830381865afa158015612f4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f6f9190615617565b9050438110612fda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f686d6d6d6d207768617420646f696e673f0000000000000000000000000000006044820152606401610755565b6000838152600960209081526040918290208251606081018452815481526001820154928101929092526002015473ffffffffffffffffffffffffffffffffffffffff9081168284015260055492517f8b3645150000000000000000000000000000000000000000000000000000000081526004810187905291921690638b36451590602401602060405180830381865afa15801561307d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130a19190615592565b156131785760408082015173ffffffffffffffffffffffffffffffffffffffff166000908152600d602052908120906130da8287613cba565b6130e457426130ea565b81600301545b9050601354601654101561312a576201518060105484602001518361310f91906154a9565b61311991906154c0565b613123919061552c565b9450613171565b601754836020015111156131415760009450613171565b62015180601054846020015160175461315a91906154a9565b61316491906154c0565b61316e919061552c565b94505b50506131a5565b60006131838561425d565b90508160200151600f5461319791906154a9565b6131a190826154c0565b9350505b5050919050565b60026001541415613219576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610755565b600260015533323081831480613249575060065473ffffffffffffffffffffffffffffffffffffffff8481169116145b6132af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f4f6e6c7920454f410000000000000000000000000000000000000000000000006044820152606401610755565b8173ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614613344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f6163636f756e7420746f2073656e646572206d69736d617463680000000000006044820152606401610755565b60005b845181101561368a5760065473ffffffffffffffffffffffffffffffffffffffff85811691161461356457600554855173ffffffffffffffffffffffffffffffffffffffff808716921690636352211e908890859081106133aa576133aa615558565b60200260200101516040518263ffffffff1660e01b81526004016133d091815260200190565b602060405180830381865afa1580156133ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134119190615630565b73ffffffffffffffffffffffffffffffffffffffff161461348e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f596f7520646f6e2774206f776e207468697320746f6b656e00000000000000006044820152606401610755565b600554855173ffffffffffffffffffffffffffffffffffffffff909116906323b872dd90869085908990869081106134c8576134c8615558565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b15801561354757600080fd5b505af115801561355b573d6000803e3d6000fd5b5050505061358b565b84818151811061357657613576615558565b60200260200101516000141561358b57613678565b600554855173ffffffffffffffffffffffffffffffffffffffff90911690638b364515908790849081106135c1576135c1615558565b60200260200101516040518263ffffffff1660e01b81526004016135e791815260200190565b602060405180830381865afa158015613604573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136289190615592565b15613655576136508686838151811061364357613643615558565b6020026020010151614b5b565b613678565b6136788686838151811061366b5761366b615558565b6020026020010151614d27565b80613682816155af565b915050613347565b50506001805550505050565b6000805473ffffffffffffffffffffffffffffffffffffffff163314613718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b50601255600190565b61375b60405180606001604052806000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b6005546040517f8b3645150000000000000000000000000000000000000000000000000000000081526004810184905273ffffffffffffffffffffffffffffffffffffffff90911690638b36451590602401602060405180830381865afa1580156137ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137ee9190615592565b1561384257506000908152600960209081526040918290208251606081018452815481526001820154928101929092526002015473ffffffffffffffffffffffffffffffffffffffff169181019190915290565b6000828152600b60205260408120549061385b8461425d565b6000818152600a602052604090208054919250908390811061387f5761387f615558565b60009182526020918290206040805160608101825260039093029091018054835260018101549383019390935260029092015473ffffffffffffffffffffffffffffffffffffffff1691810191909152949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314613958576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b73ffffffffffffffffffffffffffffffffffffffff81166139fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610755565b613a048161432c565b50565b60008060008060035460001415613a22579094909350915050565b60006003548663ffffffff16613a38919061564d565b60209690961c959050600080613a50600360086154a9565b90505b60088111613b07576000818152600a6020526040902054613a759082906154c0565b613a7f9083615540565b9150818310613a8d57613af5565b6000818152600a602052604081208054613aa7908b61564d565b81548110613ab757613ab7615558565b600091825260209091206003909102016002810154905473ffffffffffffffffffffffffffffffffffffffff9091169a909950975050505050505050565b80613aff816155af565b915050613a53565b509296919550909350505050565b60025460ff1615613b82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610755565b600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613bd53390565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b60025460ff16613c6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610755565b600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33613bd5565b60008181526001830160205260408120541515611b4e565b60008281526009602090815260408083208151606081018352815481526001820154938101939093526002015473ffffffffffffffffffffffffffffffffffffffff169082018190523391908214613d86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f446f6e2774206f776e2074686520676976656e20746f6b656e000000000000006044820152606401610755565b6013546016541015613dc45762015180601054826020015186613da991906154a9565b613db391906154c0565b613dbd919061552c565b9250613e0b565b60175481602001511115613ddb5760009250613e0b565b620151806010548260200151601754613df491906154a9565b613dfe91906154c0565b613e08919061552c565b92505b6000606460125485613e1d91906154c0565b613e27919061552c565b9050613e3281614e5b565b60646012546064613e4391906154a9565b613e4d90866154c0565b613e57919061552c565b6040805160608101825288815242602080830191825273ffffffffffffffffffffffffffffffffffffffff88811684860190815260008d815260098452868120955186559351600186015551600290940180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169490911693909317909255825184815291820185905292965088917f7fff0263d8628d4ea53d366f5212365f19b220057d780c47ea6a2a1d88009c27910160405180910390a350505092915050565b600080336005546040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101869052919250309173ffffffffffffffffffffffffffffffffffffffff90911690636352211e90602401602060405180830381865afa158015613f93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fb79190615630565b73ffffffffffffffffffffffffffffffffffffffff1614614034576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f446f65736e2774206f776e20746f6b656e0000000000000000000000000000006044820152606401610755565b600061403f8461425d565b6000818152600a60209081526040808320888452600b90925282205481549394509192909190811061407357614073615558565b60009182526020918290206040805160608101825260039093029091018054835260018101549383019390935260029092015473ffffffffffffffffffffffffffffffffffffffff908116928201839052909250841614614130576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f446f65736e2774206f776e20746f6b656e0000000000000000000000000000006044820152606401610755565b8060200151600f5461414291906154a9565b61414c90836154c0565b60408051606081018252878152600f5460208083019190915273ffffffffffffffffffffffffffffffffffffffff8716828401526000868152600a82528381208a8252600b90925292909220548254939750909281106141ae576141ae615558565b60009182526020808320845160039093020191825583015160018201556040928301516002909101805473ffffffffffffffffffffffffffffffffffffffff9092167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216919091179055905186907fc551c58339a72b80275245a1929922436a305c9db411049144564e959612f1fe9061424d9088815260200190565b60405180910390a3505050919050565b6005546040517f94e5684700000000000000000000000000000000000000000000000000000000815260048101839052600091829173ffffffffffffffffffffffffffffffffffffffff909116906394e568479060240161014060405180830381865afa1580156142d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142f69190615661565b90508061012001516008611b1891906154a9565b6000611b4e8383614eb4565b6000611b51825490565b6000611b4e8383614fa7565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000611b4e8383614fd1565b600080336005546040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101869052919250309173ffffffffffffffffffffffffffffffffffffffff90911690636352211e90602401602060405180830381865afa158015614425573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144499190615630565b73ffffffffffffffffffffffffffffffffffffffff16146144c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f446f65736e2774206f776e20746f6b656e0000000000000000000000000000006044820152606401610755565b60006144d18461425d565b6000818152600a60209081526040808320888452600b90925282205481549394509192909190811061450557614505615558565b60009182526020918290206040805160608101825260039093029091018054835260018101549383019390935260029092015473ffffffffffffffffffffffffffffffffffffffff9081169282018390529092508416146145c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f446f65736e2774206f776e20746f6b656e0000000000000000000000000000006044820152606401610755565b8060200151600f546145d491906154a9565b6145de90836154c0565b935081600360008282546145f291906154a9565b90915550506000828152600a602052604081208054614613906001906154a9565b8154811061462357614623615558565b60009182526020808320604080516060810182526003909402909101805484526001810154848401526002015473ffffffffffffffffffffffffffffffffffffffff1683820152868452600a82528084208a8552600b909252909220548254919350839291811061469657614696615558565b60009182526020808320845160039390930201918255838101516001830155604093840151600290920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90931692909217909155888252600b8152828220548451835283832055858252600a90522080548061472d5761472d6155e8565b6000828152602080822060037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909401938402018281556001810183905560020180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905591909255878252600b8152604080832083905573ffffffffffffffffffffffffffffffffffffffff87168352600c90915290206147d1908761430a565b506005546040517fb88d4fde00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff86811660248301526044820189905260806064830152600060848301529091169063b88d4fde9060a401600060405180830381600087803b15801561485a57600080fd5b505af115801561486e573d6000803e3d6000fd5b5050604051878152600192508891507fc551c58339a72b80275245a1929922436a305c9db411049144564e959612f1fe9060200160405180910390a350505050919050565b60008381526009602090815260408083208151606081018352815481526001820154938101939093526002015473ffffffffffffffffffffffffffffffffffffffff16908201819052829133918214614968576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f446f6e2774206f776e2074686520676976656e20746f6b656e000000000000006044820152606401610755565b60135460165410156149a6576201518060105482602001518861498b91906154a9565b61499591906154c0565b61499f919061552c565b93506149ed565b601754816020015111156149bd57600093506149ed565b6201518060105482602001516017546149d691906154a9565b6149e091906154c0565b6149ea919061552c565b93505b8415614a04578392506149ff83614e5b565b600093505b60008781526009602090815260408083208381556001810184905560020180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905573ffffffffffffffffffffffffffffffffffffffff85168352600c9091529020614a72908861430a565b506005546040517fb88d4fde00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8481166024830152604482018a905260806064830152600060848301529091169063b88d4fde9060a401600060405180830381600087803b158015614afb57600080fd5b505af1158015614b0f573d6000803e3d6000fd5b50506040805187815260208101879052600193508a92507f7fff0263d8628d4ea53d366f5212365f19b220057d780c47ea6a2a1d88009c27910160405180910390a35050509392505050565b60025460ff1615614bc8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610755565b6013546016541015614c25576201518060105460045460175442614bec91906154a9565b614bf691906154c0565b614c0091906154c0565b614c0a919061552c565b60166000828254614c1b9190615540565b9091555050426017555b6040805160608101825282815242602080830182815273ffffffffffffffffffffffffffffffffffffffff878116858701818152600089815260098652888120975188559351600188015551600290960180547fffffffffffffffffffffffff00000000000000000000000000000000000000001696909216959095179055928352600c9052919020614cb890836143a1565b50600160046000828254614ccc9190615540565b9091555050604051818152600190839073ffffffffffffffffffffffffffffffffffffffff8616907f8612e8567c2b59ea0cd07546cc5fd09fdcb85f542e6d73367c39b009ce24a0bf906020015b60405180910390a4505050565b6000614d328261425d565b90508060036000828254614d469190615540565b90915550506000818152600a602081815260408084208054878652600b84528286208190559383528151606081018352878152600f5481850190815273ffffffffffffffffffffffffffffffffffffffff8a81168386018181526001808a018755958a52878a20945160039099029094019788559151938701939093559051600290950180547fffffffffffffffffffffffff00000000000000000000000000000000000000001695909216949094179055918352600c90529020614e0b90836143a1565b5060001515828473ffffffffffffffffffffffffffffffffffffffff167f8612e8567c2b59ea0cd07546cc5fd09fdcb85f542e6d73367c39b009ce24a0bf600f54604051614d1a91815260200190565b600354614e7c5780600e6000828254614e749190615540565b909155505050565b600354600e54614e8c9083615540565b614e96919061552c565b600f6000828254614ea79190615540565b90915550506000600e5550565b60008181526001830160205260408120548015614f9d576000614ed86001836154a9565b8554909150600090614eec906001906154a9565b9050818114614f51576000866000018281548110614f0c57614f0c615558565b9060005260206000200154905080876000018481548110614f2f57614f2f615558565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080614f6257614f626155e8565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611b51565b6000915050611b51565b6000826000018281548110614fbe57614fbe615558565b9060005260206000200154905092915050565b600081815260018301602052604081205461501857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611b51565b506000611b51565b5080546000825590600052602060002090810190613a0491905b8082111561504e576000815560010161503a565b5090565b73ffffffffffffffffffffffffffffffffffffffff81168114613a0457600080fd5b60008060008060006080868803121561508c57600080fd5b853561509781615052565b945060208601356150a781615052565b935060408601359250606086013567ffffffffffffffff808211156150cb57600080fd5b818801915088601f8301126150df57600080fd5b8135818111156150ee57600080fd5b89602082850101111561510057600080fd5b9699959850939650602001949392505050565b8015158114613a0457600080fd5b60006020828403121561513357600080fd5b8135611b1881615113565b60006020828403121561515057600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610140810167ffffffffffffffff811182821017156151aa576151aa615157565b60405290565b600082601f8301126151c157600080fd5b8135602067ffffffffffffffff808311156151de576151de615157565b8260051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110848211171561522157615221615157565b60405293845285810183019383810192508785111561523f57600080fd5b83870191505b8482101561525e57813583529183019190830190615245565b979650505050505050565b60006020828403121561527b57600080fd5b813567ffffffffffffffff81111561529257600080fd5b61529e848285016151b0565b949350505050565b6000806000606084860312156152bb57600080fd5b83356152c681615052565b95602085013595506040909401359392505050565b6020808252825182820181905260009190848201906040850190845b81811015615313578351835292840192918401916001016152f7565b50909695505050505050565b60006020828403121561533157600080fd5b8135611b1881615052565b6000806040838503121561534f57600080fd5b823561535a81615052565b946020939093013593505050565b6000806000806080858703121561537e57600080fd5b843561538981615052565b9350602085013561539981615052565b925060408501356153a981615052565b915060608501356153b981615052565b939692955090935050565b6020808252825160608383015280516080840181905260009291820190839060a08601905b8083101561540957835182529284019260019290920191908401906153e9565b50838701516040870152604087015160608701528094505050505092915050565b6000806040838503121561543d57600080fd5b823561544881615052565b9150602083013567ffffffffffffffff81111561546457600080fd5b615470858286016151b0565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156154bb576154bb61547a565b500390565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156154f8576154f861547a565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261553b5761553b6154fd565b500490565b600082198211156155535761555361547a565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b8051610a2e81615113565b6000602082840312156155a457600080fd5b8151611b1881615113565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156155e1576155e161547a565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60006020828403121561562957600080fd5b5051919050565b60006020828403121561564257600080fd5b8151611b1881615052565b60008261565c5761565c6154fd565b500690565b6000610140828403121561567457600080fd5b61567c615186565b61568583615587565b81526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e0820152610100808401518183015250610120808401518183015250809150509291505056fea264697066735822122053acaa171a20c75c1325bf0a4c70d595acd550ab46465eb855e0d2c1bab2c50564736f6c634300080b0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Validator ID :
0 FTM

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

Downtime
0 s
Address Amount claimed Rewards Created On Epoch Created On
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.