ETH Price: $3,516.50 (-1.58%)
Gas: 24 Gwei

Contract

0xF042A49FB03cb9D98CbA9DEf8711CEE85dC72281
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Rescue194578762024-03-17 23:38:2311 days ago1710718703IN
Wizards & Dragons: Tower V1
0 ETH0.0066619928.76012815
Rescue194578182024-03-17 23:26:4711 days ago1710718007IN
Wizards & Dragons: Tower V1
0 ETH0.0032812327.08249689
Rescue183742412023-10-18 2:23:35163 days ago1697595815IN
Wizards & Dragons: Tower V1
0 ETH0.001226796.7203775
Rescue168780352023-03-21 19:18:23373 days ago1679426303IN
Wizards & Dragons: Tower V1
0 ETH0.0035698819.55578645
Rescue163096492023-01-01 4:52:59453 days ago1672548779IN
Wizards & Dragons: Tower V1
0 ETH0.0015826914.53916969
Rescue163096472023-01-01 4:52:35453 days ago1672548755IN
Wizards & Dragons: Tower V1
0 ETH0.0016693313.77829395
Rescue161090952022-12-04 4:35:11481 days ago1670128511IN
Wizards & Dragons: Tower V1
0 ETH0.0015145711.65413478
Rescue161090682022-12-04 4:29:47481 days ago1670128187IN
Wizards & Dragons: Tower V1
0 ETH0.0014541312.00210914
Rescue159560942022-11-12 19:41:47502 days ago1668282107IN
Wizards & Dragons: Tower V1
0 ETH0.0062361612.68969982
Transfer Ownersh...158125882022-10-23 18:25:47522 days ago1666549547IN
Wizards & Dragons: Tower V1
0 ETH0.00629706220
Rescue156572612022-10-02 1:46:11544 days ago1664675171IN
Wizards & Dragons: Tower V1
0 ETH0.001109946.08028
Rescue147308302022-05-07 16:25:36691 days ago1651940736IN
Wizards & Dragons: Tower V1
0 ETH0.0052944343.69895502
Rescue147243822022-05-06 15:41:54692 days ago1651851714IN
Wizards & Dragons: Tower V1
0 ETH0.0153276556.80191338
Rescue147204102022-05-06 0:37:10693 days ago1651797430IN
Wizards & Dragons: Tower V1
0 ETH0.0073662940.3524227
Rescue147024002022-05-03 3:59:54696 days ago1651550394IN
Wizards & Dragons: Tower V1
0 ETH0.0095156478.53980953
Rescue146926742022-05-01 15:08:03697 days ago1651417683IN
Wizards & Dragons: Tower V1
0 ETH0.0080277861.77123182
Rescue146781872022-04-29 8:44:17699 days ago1651221857IN
Wizards & Dragons: Tower V1
0 ETH0.0036403830.04686021
Rescue146770602022-04-29 4:21:20700 days ago1651206080IN
Wizards & Dragons: Tower V1
0 ETH0.0047457539.17033261
Rescue146657532022-04-27 9:43:21701 days ago1651052601IN
Wizards & Dragons: Tower V1
0 ETH0.0029501926.6111794
Add Many To Towe...146627782022-04-26 22:29:54702 days ago1651012194IN
Wizards & Dragons: Tower V1
0 ETH0.0074262553.26308877
Rescue146509932022-04-25 1:50:51704 days ago1650851451IN
Wizards & Dragons: Tower V1
0 ETH0.0132187733.66752401
Rescue146453952022-04-24 4:41:55705 days ago1650775315IN
Wizards & Dragons: Tower V1
0 ETH0.2623995526.9121483
Rescue146325312022-04-22 4:27:18707 days ago1650601638IN
Wizards & Dragons: Tower V1
0 ETH0.0058578148.34894468
Rescue146073792022-04-18 5:46:28711 days ago1650260788IN
Wizards & Dragons: Tower V1
0 ETH0.0351634526.06639014
Rescue146024202022-04-17 11:03:43711 days ago1650193423IN
Wizards & Dragons: Tower V1
0 ETH0.0040694416.68213686
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Tower

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 15 : Tower.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

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 "./interfaces/IWnDGame.sol";
import "./interfaces/IWnD.sol";
import "./interfaces/IGP.sol";
import "./interfaces/ITower.sol";
import "./interfaces/ISacrificialAlter.sol";
import "./interfaces/IRandomizer.sol";

contract Tower is ITower, Ownable, ReentrancyGuard, IERC721Receiver, Pausable {
  
  // maximum rank for a Wizard/Dragon
  uint8 public constant MAX_RANK = 8;

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

  uint256 private totalRankStaked;
  uint256 private numWizardsStaked;

  event TokenStaked(address indexed owner, uint256 indexed tokenId, bool indexed isWizard, uint256 value);
  event WizardClaimed(uint256 indexed tokenId, bool indexed unstaked, uint256 earned);
  event DragonClaimed(uint256 indexed tokenId, bool indexed unstaked, uint256 earned);

  // reference to the WnD NFT contract
  IWnD public wndNFT;
  // reference to the WnD NFT contract
  IWnDGame public wndGame;
  // reference to the $GP contract for minting $GP earnings
  IGP public gpToken;
  // reference to Randomer 
  IRandomizer public randomizer;

  // maps tokenId to stake
  mapping(uint256 => Stake) private tower; 
  // maps rank to all Dragon staked with that rank
  mapping(uint256 => Stake[]) private flight; 
  // tracks location of each Dragon in Flight
  mapping(uint256 => uint256) private flightIndices; 
  // any rewards distributed when no dragons are staked
  uint256 private unaccountedRewards = 0; 
  // amount of $GP due for each rank point staked
  uint256 private gpPerRank = 0; 

  // wizards earn 12000 $GP per day
  uint256 public constant DAILY_GP_RATE = 12000 ether;
  // wizards must have 2 days worth of $GP to unstake or else they're still guarding the tower
  uint256 public constant MINIMUM_TO_EXIT = 2 days;
  // dragons take a 20% tax on all $GP claimed
  uint256 public constant GP_CLAIM_TAX_PERCENTAGE = 20;
  // there will only ever be (roughly) 2.4 billion $GP earned through staking
  uint256 public constant MAXIMUM_GLOBAL_GP = 2880000000 ether;
  uint256 public treasureChestTypeId;

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

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

  /**
   */
  constructor() {
    _pause();
  }

  /** CRITICAL TO SETUP */

  modifier requireContractsSet() {
      require(address(wndNFT) != address(0) && address(gpToken) != address(0) 
        && address(wndGame) != address(0) && address(randomizer) != address(0), "Contracts not set");
      _;
  }

  function setContracts(address _wndNFT, address _gp, address _wndGame, address _rand) external onlyOwner {
    wndNFT = IWnD(_wndNFT);
    gpToken = IGP(_gp);
    wndGame = IWnDGame(_wndGame);
    randomizer = IRandomizer(_rand);
  }

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

  /** STAKING */

  /**
   * adds Wizards and Dragons to the Tower and Flight
   * @param account the address of the staker
   * @param tokenIds the IDs of the Wizards and Dragons to stake
   */
  function addManyToTowerAndFlight(address account, uint16[] calldata tokenIds) external override nonReentrant {
    require(tx.origin == _msgSender() || _msgSender() == address(wndGame), "Only EOA");
    require(account == tx.origin, "account to sender mismatch");
    for (uint i = 0; i < tokenIds.length; i++) {
      if (_msgSender() != address(wndGame)) { // dont do this step if its a mint + stake
        require(wndNFT.ownerOf(tokenIds[i]) == _msgSender(), "You don't own this token");
        wndNFT.transferFrom(_msgSender(), address(this), tokenIds[i]);
      } else if (tokenIds[i] == 0) {
        continue; // there may be gaps in the array for stolen tokens
      }

      if (wndNFT.isWizard(tokenIds[i])) 
        _addWizardToTower(account, tokenIds[i]);
      else 
        _addDragonToFlight(account, tokenIds[i]);
    }
  }

  /**
   * adds a single Wizard to the Tower
   * @param account the address of the staker
   * @param tokenId the ID of the Wizard to add to the Tower
   */
  function _addWizardToTower(address account, uint256 tokenId) internal whenNotPaused _updateEarnings {
    tower[tokenId] = Stake({
      owner: account,
      tokenId: uint16(tokenId),
      value: uint80(block.timestamp)
    });
    numWizardsStaked += 1;
    emit TokenStaked(account, tokenId, true, block.timestamp);
  }

  /**
   * adds a single Dragon to the Flight
   * @param account the address of the staker
   * @param tokenId the ID of the Dragon to add to the Flight
   */
  function _addDragonToFlight(address account, uint256 tokenId) internal {
    uint8 rank = _rankForDragon(tokenId);
    totalRankStaked += rank; // Portion of earnings ranges from 8 to 5
    flightIndices[tokenId] = flight[rank].length; // Store the location of the dragon in the Flight
    flight[rank].push(Stake({
      owner: account,
      tokenId: uint16(tokenId),
      value: uint80(gpPerRank)
    })); // Add the dragon to the Flight
    emit TokenStaked(account, tokenId, false, gpPerRank);
  }

  /** CLAIMING / UNSTAKING */

  /**
   * realize $GP earnings and optionally unstake tokens from the Tower / Flight
   * to unstake a Wizard it will require it has 2 days worth of $GP unclaimed
   * @param tokenIds the IDs of the tokens to claim earnings from
   * @param unstake whether or not to unstake ALL of the tokens listed in tokenIds
   */
  function claimManyFromTowerAndFlight(uint16[] calldata tokenIds, bool unstake) external whenNotPaused _updateEarnings nonReentrant {
    require(tx.origin == _msgSender() || _msgSender() == address(wndGame), "Only EOA");
    uint256 owed = 0;
    for (uint i = 0; i < tokenIds.length; i++) {
      if (wndNFT.isWizard(tokenIds[i])) {
        owed += _claimWizardFromTower(tokenIds[i], unstake);
      }
      else {
        owed += _claimDragonFromFlight(tokenIds[i], unstake);
      }
    }
    gpToken.updateOriginAccess();
    if (owed == 0) {
      return;
    }
    gpToken.mint(_msgSender(), owed);
  }

  function calculateRewards(uint256 tokenId) external view returns (uint256 owed) {
    uint64 lastTokenWrite = wndNFT.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 = tower[tokenId];
    if(wndNFT.isWizard(tokenId)) {
      if (totalGPEarned < MAXIMUM_GLOBAL_GP) {
        owed = (block.timestamp - stake.value) * DAILY_GP_RATE / 1 days;
      } else if (stake.value > lastClaimTimestamp) {
        owed = 0; // $GP production stopped already
      } else {
        owed = (lastClaimTimestamp - stake.value) * DAILY_GP_RATE / 1 days; // stop earning additional $GP if it's all been earned
      }
    }
    else {
      uint8 rank = _rankForDragon(tokenId);
      owed = (rank) * (gpPerRank - stake.value); // Calculate portion of tokens based on Rank
    }
  }

  /**
   * realize $GP earnings for a single Wizard and optionally unstake it
   * if not unstaking, pay a 20% tax to the staked Dragons
   * if unstaking, there is a 50% chance all $GP is stolen
   * @param tokenId the ID of the Wizards to claim earnings from
   * @param unstake whether or not to unstake the Wizards
   * @return owed - the amount of $GP earned
   */
  function _claimWizardFromTower(uint256 tokenId, bool unstake) internal returns (uint256 owed) {
    Stake memory stake = tower[tokenId];
    require(stake.owner == _msgSender(), "Don't own the given token");
    require(!(unstake && block.timestamp - stake.value < MINIMUM_TO_EXIT), "Still guarding the tower");
    if (totalGPEarned < MAXIMUM_GLOBAL_GP) {
      owed = (block.timestamp - stake.value) * DAILY_GP_RATE / 1 days;
    } else if (stake.value > lastClaimTimestamp) {
      owed = 0; // $GP production stopped already
    } else {
      owed = (lastClaimTimestamp - stake.value) * DAILY_GP_RATE / 1 days; // stop earning additional $GP if it's all been earned
    }
    if (unstake) {
      if (randomizer.random() & 1 == 1) { // 50% chance of all $GP stolen
        _payDragonTax(owed);
        owed = 0;
      }
      delete tower[tokenId];
      numWizardsStaked -= 1;
      // Always transfer last to guard against reentrance
      wndNFT.safeTransferFrom(address(this), _msgSender(), tokenId, ""); // send back Wizard
    } else {
      _payDragonTax(owed * GP_CLAIM_TAX_PERCENTAGE / 100); // percentage tax to staked dragons
      owed = owed * (100 - GP_CLAIM_TAX_PERCENTAGE) / 100; // remainder goes to Wizard owner
      tower[tokenId] = Stake({
        owner: _msgSender(),
        tokenId: uint16(tokenId),
        value: uint80(block.timestamp)
      }); // reset stake
    }
    emit WizardClaimed(tokenId, unstake, owed);
  }

  /**
   * realize $GP earnings for a single Dragon and optionally unstake it
   * Dragons earn $GP proportional to their rank
   * @param tokenId the ID of the Dragon to claim earnings from
   * @param unstake whether or not to unstake the Dragon
   * @return owed - the amount of $GP earned
   */
  function _claimDragonFromFlight(uint256 tokenId, bool unstake) internal returns (uint256 owed) {
    require(wndNFT.ownerOf(tokenId) == address(this), "Doesn't own token");
    uint8 rank = _rankForDragon(tokenId);
    Stake memory stake = flight[rank][flightIndices[tokenId]];
    require(stake.owner == _msgSender(), "Doesn't own token");
    owed = (rank) * (gpPerRank - stake.value); // Calculate portion of tokens based on Rank
    if (unstake) {
      totalRankStaked -= rank; // Remove rank from total staked
      Stake memory lastStake = flight[rank][flight[rank].length - 1];
      flight[rank][flightIndices[tokenId]] = lastStake; // Shuffle last Dragon to current position
      flightIndices[lastStake.tokenId] = flightIndices[tokenId];
      flight[rank].pop(); // Remove duplicate
      delete flightIndices[tokenId]; // Delete old mapping
      // Always remove last to guard against reentrance
      wndNFT.safeTransferFrom(address(this), _msgSender(), tokenId, ""); // Send back Dragon
    } else {
      flight[rank][flightIndices[tokenId]] = Stake({
        owner: _msgSender(),
        tokenId: uint16(tokenId),
        value: uint80(gpPerRank)
      }); // reset stake
    }
    emit DragonClaimed(tokenId, unstake, owed);
  }
  /**
   * emergency unstake tokens
   * @param tokenIds the IDs of the tokens to claim earnings from
   */
  function rescue(uint256[] calldata tokenIds) external nonReentrant {
    require(rescueEnabled, "RESCUE DISABLED");
    uint256 tokenId;
    Stake memory stake;
    Stake memory lastStake;
    uint8 rank;
    for (uint i = 0; i < tokenIds.length; i++) {
      tokenId = tokenIds[i];
      if (wndNFT.isWizard(tokenId)) {
        stake = tower[tokenId];
        require(stake.owner == _msgSender(), "SWIPER, NO SWIPING");
        delete tower[tokenId];
        numWizardsStaked -= 1;
        wndNFT.safeTransferFrom(address(this), _msgSender(), tokenId, ""); // send back Wizards
        emit WizardClaimed(tokenId, true, 0);
      } else {
        rank = _rankForDragon(tokenId);
        stake = flight[rank][flightIndices[tokenId]];
        require(stake.owner == _msgSender(), "SWIPER, NO SWIPING");
        totalRankStaked -= rank; // Remove Rank from total staked
        lastStake = flight[rank][flight[rank].length - 1];
        flight[rank][flightIndices[tokenId]] = lastStake; // Shuffle last Dragon to current position
        flightIndices[lastStake.tokenId] = flightIndices[tokenId];
        flight[rank].pop(); // Remove duplicate
        delete flightIndices[tokenId]; // Delete old mapping
        wndNFT.safeTransferFrom(address(this), _msgSender(), tokenId, ""); // Send back Dragon
        emit DragonClaimed(tokenId, true, 0);
      }
    }
  }

  /** ACCOUNTING */

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

  /**
   * tracks $GP earnings to ensure it stops once 2.4 billion is eclipsed
   */
  modifier _updateEarnings() {
    if (totalGPEarned < MAXIMUM_GLOBAL_GP) {
      totalGPEarned += 
        (block.timestamp - lastClaimTimestamp)
        * numWizardsStaked
        * DAILY_GP_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 Dragon
   * @param tokenId the ID of the Dragon to get the rank score for
   * @return the rank score of the Dragon (5-8)
   */
  function _rankForDragon(uint256 tokenId) internal view returns (uint8) {
    IWnD.WizardDragon memory s = wndNFT.getTokenTraits(tokenId);
    return MAX_RANK - s.rankIndex; // rank index is 0-3
  }

  /**
   * chooses a random Dragon thief when a newly minted token is stolen
   * @param seed a random value to choose a Dragon from
   * @return the owner of the randomly selected Dragon thief
   */
  function randomDragonOwner(uint256 seed) external view override returns (address) {
    if (totalRankStaked == 0) {
      return address(0x0);
    }
    uint256 bucket = (seed & 0xFFFFFFFF) % totalRankStaked; // choose a value from 0 to total rank staked
    uint256 cumulative;
    seed >>= 32;
    // loop through each bucket of Dragons with the same rank score
    for (uint 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 Dragon with that rank score
      return flight[i][seed % flight[i].length].owner;
    }
    return address(0x0);
  }

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

  
}

File 3 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 4 of 15 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 6 of 15 : Pausable.sol
// SPDX-License-Identifier: MIT

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

pragma solidity ^0.8.0;

interface IWnDGame {
  
}

File 8 of 15 : IWnD.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

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

interface IWnD is IERC721Enumerable {

    // game data storage
    struct WizardDragon {
        bool isWizard;
        uint8 body;
        uint8 head;
        uint8 spell;
        uint8 eyes;
        uint8 neck;
        uint8 mouth;
        uint8 wand;
        uint8 tail;
        uint8 rankIndex;
    }

    function minted() external returns (uint16);
    function updateOriginAccess(uint16[] memory tokenIds) external;
    function mint(address recipient, uint256 seed) 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 (WizardDragon memory);
    function getTokenWriteBlock(uint256 tokenId) external view returns(uint64);
    function isWizard(uint256 tokenId) external view returns(bool);
  
}

File 9 of 15 : IGP.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

interface IGP {
    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 10 of 15 : ITower.sol
// SPDX-License-Identifier: MIT LICENSE 

pragma solidity ^0.8.0;

interface ITower {
  function addManyToTowerAndFlight(address account, uint16[] calldata tokenIds) external;
  function randomDragonOwner(uint256 seed) external view returns (address);
}

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

pragma solidity ^0.8.0;

interface ISacrificialAlter {
    function mint(uint256 typeId, uint16 qty, address recipient) external;
    function burn(uint256 typeId, uint16 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 12 of 15 : IRandomizer.sol
pragma solidity ^0.8.0;

interface IRandomizer {
    function random() external returns (uint256);
}

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

pragma solidity ^0.8.0;

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

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

File 14 of 15 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

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

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

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

pragma solidity ^0.8.0;

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

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

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"}],"name":"DragonClaimed","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":"isWizard","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"},{"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":"WizardClaimed","type":"event"},{"inputs":[],"name":"DAILY_GP_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GP_CLAIM_TAX_PERCENTAGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_GLOBAL_GP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_RANK","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"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":"uint16[]","name":"tokenIds","type":"uint16[]"}],"name":"addManyToTowerAndFlight","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":"uint16[]","name":"tokenIds","type":"uint16[]"},{"internalType":"bool","name":"unstake","type":"bool"}],"name":"claimManyFromTowerAndFlight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gpToken","outputs":[{"internalType":"contract IGP","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":"randomDragonOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"_wndNFT","type":"address"},{"internalType":"address","name":"_gp","type":"address"},{"internalType":"address","name":"_wndGame","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":[],"name":"totalGPEarned","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":[],"name":"wndGame","outputs":[{"internalType":"contract IWnDGame","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wndNFT","outputs":[{"internalType":"contract IWnD","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040526000600c819055600d556011805460ff191690553480156200002557600080fd5b5062000031336200004f565b600180556002805460ff19169055620000496200009f565b6200013d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60025460ff1615620000ea5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640160405180910390fd5b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258620001203390565b6040516001600160a01b03909116815260200160405180910390a1565b612c1a806200014d6000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80638da5cb5b116100de578063d3ea435011610097578063e74c6bb511610071578063e74c6bb514610357578063f10fb58414610360578063f2fde38b14610373578063f8b2a46e1461038657600080fd5b8063d3ea43501461031e578063da7f5c8e14610331578063e12b635b1461034457600080fd5b80638da5cb5b146102b45780639e3bcb8d146102c5578063a2f47a66146102df578063bf989b6e146102f0578063ce6c121814610303578063d121e7651461030b57600080fd5b80635c975abb1161014b5780636f7bb00a116101255780636f7bb00a1461025b578063715018a614610286578063765310081461028e5780638336a6cf146102a157600080fd5b80635c975abb1461022a57806362bd92ae146102355780636a3ef0571461024857600080fd5b80630530587514610193578063150b7a02146101af57806316c38b3c146101db5780631f4fb37a146101f057806337a386b91461020357806339db714f1461020d575b600080fd5b61019c600f5481565b6040519081526020015b60405180910390f35b6101c26101bd3660046126e5565b610399565b6040516001600160e01b031990911681526020016101a6565b6101ee6101e9366004612867565b610409565b005b6101ee6101fe366004612988565b6104dc565b61019c6202a30081565b60115461021a9060ff1681565b60405190151581526020016101a6565b60025460ff1661021a565b6101ee61024336600461277f565b61050b565b6101ee610256366004612827565b610975565b60075461026e906001600160a01b031681565b6040516001600160a01b0390911681526020016101a6565b6101ee610f6e565b6101ee61029c366004612867565b610fa4565b61026e6102af366004612988565b610fe1565b6000546001600160a01b031661026e565b6102cd600881565b60405160ff90911681526020016101a6565b61019c69028a857425466f80000081565b6101ee6102fe36600461268a565b6110de565b61019c601481565b61019c6b094e47b8d68171534000000081565b61019c61032c366004612988565b611158565b6101ee61033f3660046127d2565b6113d6565b60065461026e906001600160a01b031681565b61019c600e5481565b60085461026e906001600160a01b031681565b6101ee610381366004612652565b61175a565b60055461026e906001600160a01b031681565b60006001600160a01b038516156103f75760405162461bcd60e51b815260206004820152601d60248201527f43616e6e6f742073656e6420746f20546f776572206469726563746c7900000060448201526064015b60405180910390fd5b50630a85bd0160e11b95945050505050565b6005546001600160a01b03161580159061042d57506007546001600160a01b031615155b801561044357506006546001600160a01b031615155b801561045957506008546001600160a01b031615155b6104995760405162461bcd60e51b815260206004820152601160248201527010dbdb9d1c9858dd1cc81b9bdd081cd95d607a1b60448201526064016103ee565b6000546001600160a01b031633146104c35760405162461bcd60e51b81526004016103ee90612a3d565b80156104d4576104d16117f2565b50565b6104d1611867565b6000546001600160a01b031633146105065760405162461bcd60e51b81526004016103ee90612a3d565b600e55565b6002600154141561052e5760405162461bcd60e51b81526004016103ee90612a72565b60026001553233148061055457506006546001600160a01b0316336001600160a01b0316145b61058b5760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920454f4160c01b60448201526064016103ee565b6001600160a01b03831632146105e35760405162461bcd60e51b815260206004820152601a60248201527f6163636f756e7420746f2073656e646572206d69736d6174636800000000000060448201526064016103ee565b60005b8181101561096b576006546001600160a01b0316336001600160a01b0316146107d15760055433906001600160a01b0316636352211e85858581811061063c57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106519190612966565b6040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b15801561068b57600080fd5b505afa15801561069f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c3919061266e565b6001600160a01b0316146107195760405162461bcd60e51b815260206004820152601860248201527f596f7520646f6e2774206f776e207468697320746f6b656e000000000000000060448201526064016103ee565b6005546001600160a01b03166323b872dd333086868681811061074c57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906107619190612966565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015261ffff166044820152606401600060405180830381600087803b1580156107b457600080fd5b505af11580156107c8573d6000803e3d6000fd5b50505050610813565b8282828181106107f157634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108069190612966565b61ffff1661081357610959565b6005546001600160a01b031663ff53f47384848481811061084457634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108599190612966565b6040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b15801561089357600080fd5b505afa1580156108a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cb9190612883565b1561091757610912848484848181106108f457634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109099190612966565b61ffff166118e1565b610959565b6109598484848481811061093b57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109509190612966565b61ffff16611a54565b8061096381612b66565b9150506105e6565b5050600180555050565b600260015414156109985760405162461bcd60e51b81526004016103ee90612a72565b600260015560115460ff166109e15760405162461bcd60e51b815260206004820152600f60248201526e149154d0d55148111254d050931151608a1b60448201526064016103ee565b60408051606080820183526000808352602080840182905283850182905284519283018552818352820181905292810183905282805b85811015610f6157868682818110610a3f57634e487b7160e01b600052603260045260246000fd5b600554604051600162ac0b8d60e01b0319815260209290920293909301356004820181905297506001600160a01b039092169163ff53f473915060240160206040518083038186803b158015610a9457600080fd5b505afa158015610aa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acc9190612883565b15610c31576000858152600960209081526040918290208251606081018452905461ffff811682526201000081046001600160501b031692820192909252600160601b9091046001600160a01b031691810182905294503314610b665760405162461bcd60e51b81526020600482015260126024820152715357495045522c204e4f2053574950494e4760701b60448201526064016103ee565b60008581526009602052604081208190556004805460019290610b8a908490612b2c565b90915550506005546001600160a01b031663b88d4fde3033886040518463ffffffff1660e01b8152600401610bc1939291906129e0565b600060405180830381600087803b158015610bdb57600080fd5b505af1158015610bef573d6000803e3d6000fd5b505060405160008152600192508791507f569d2442a75622c2ebdc65c793086aa6cc5e3917a5ed712538a06b60ed0548d09060200160405180910390a3610f4f565b610c3a85611b6b565b60ff81166000908152600a60209081526040808320898452600b90925290912054815492945090918110610c7e57634e487b7160e01b600052603260045260246000fd5b600091825260209182902060408051606081018252929091015461ffff811683526201000081046001600160501b031693830193909352600160601b9092046001600160a01b031691810182905294503314610d115760405162461bcd60e51b81526020600482015260126024820152715357495045522c204e4f2053574950494e4760701b60448201526064016103ee565b8160ff1660036000828254610d269190612b2c565b909155505060ff82166000908152600a602052604090208054610d4b90600190612b2c565b81548110610d6957634e487b7160e01b600052603260045260246000fd5b6000918252602080832060408051606081018252939091015461ffff811684526201000081046001600160501b031684840152600160601b90046001600160a01b03168382015260ff86168452600a8252808420898552600b9092529092205482549195508592918110610ded57634e487b7160e01b600052603260045260246000fd5b60009182526020808320845192018054858301516040968701516001600160a01b0316600160601b026001600160601b036001600160501b0390921662010000026001600160601b031990931661ffff968716179290921716179055888352600b815283832054875190921683528383209190915560ff85168252600a905220805480610e8a57634e487b7160e01b600052603160045260246000fd5b600082815260208082206000199084018101839055909201909255868252600b905260408120556005546001600160a01b031663b88d4fde3033886040518463ffffffff1660e01b8152600401610ee3939291906129e0565b600060405180830381600087803b158015610efd57600080fd5b505af1158015610f11573d6000803e3d6000fd5b505060405160008152600192508791507fc8a6b99877b30d5222ab2ba9b95286368a0257f79d4627be93478b3c57ca60cd9060200160405180910390a35b80610f5981612b66565b915050610a17565b5050600180555050505050565b6000546001600160a01b03163314610f985760405162461bcd60e51b81526004016103ee90612a3d565b610fa26000611c08565b565b6000546001600160a01b03163314610fce5760405162461bcd60e51b81526004016103ee90612a3d565b6011805460ff1916911515919091179055565b600060035460001415610ff657506000919050565b60006003548363ffffffff1661100c9190612b81565b60209390931c92905060008061102460036008612b43565b60ff1690505b600881116110d3576000818152600a602052604090205461104c908290612b0d565b6110569083612ae1565b9150818310611064576110c1565b6000818152600a60205260409020805461107e9087612b81565b8154811061109c57634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600160601b90046001600160a01b031695945050505050565b806110cb81612b66565b91505061102a565b506000949350505050565b6000546001600160a01b031633146111085760405162461bcd60e51b81526004016103ee90612a3d565b600580546001600160a01b039586166001600160a01b0319918216179091556007805494861694821694909417909355600680549285169284169290921790915560088054919093169116179055565b600554604051631d7a2e6d60e31b81526004810183905260009182916001600160a01b039091169063ebd173689060240160206040518083038186803b1580156111a157600080fd5b505afa1580156111b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d991906129b8565b9050438167ffffffffffffffff16106112285760405162461bcd60e51b8152602060048201526011602482015270686d6d6d6d207768617420646f696e673f60781b60448201526064016103ee565b6000838152600960209081526040918290208251606081018452905461ffff811682526201000081046001600160501b031692820192909252600160601b9091046001600160a01b03908116828401526005549251600162ac0b8d60e01b03198152600481018790529192169063ff53f4739060240160206040518083038186803b1580156112b657600080fd5b505afa1580156112ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ee9190612883565b15611396576b094e47b8d681715340000000600f54101561134c576201518069028a857425466f80000082602001516001600160501b0316426113319190612b2c565b61133b9190612b0d565b6113459190612af9565b92506113cf565b60105481602001516001600160501b0316111561136c57600092506113cf565b6201518069028a857425466f80000082602001516001600160501b03166010546113319190612b2c565b60006113a185611b6b565b905081602001516001600160501b0316600d546113be9190612b2c565b6113cb9060ff8316612b0d565b9350505b5050919050565b60025460ff16156113f95760405162461bcd60e51b81526004016103ee90612a13565b6b094e47b8d681715340000000600f541015611468576201518069028a857425466f8000006004546010544261142f9190612b2c565b6114399190612b0d565b6114439190612b0d565b61144d9190612af9565b600f600082825461145e9190612ae1565b9091555050426010555b6002600154141561148b5760405162461bcd60e51b81526004016103ee90612a72565b6002600155323314806114b157506006546001600160a01b0316336001600160a01b0316145b6114e85760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920454f4160c01b60448201526064016103ee565b6000805b83811015611665576005546001600160a01b031663ff53f47386868481811061152557634e487b7160e01b600052603260045260246000fd5b905060200201602081019061153a9190612966565b6040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b15801561157457600080fd5b505afa158015611588573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ac9190612883565b15611604576115f38585838181106115d457634e487b7160e01b600052603260045260246000fd5b90506020020160208101906115e99190612966565b61ffff1684611c58565b6115fd9083612ae1565b9150611653565b61164685858381811061162757634e487b7160e01b600052603260045260246000fd5b905060200201602081019061163c9190612966565b61ffff168461207d565b6116509083612ae1565b91505b8061165d81612b66565b9150506114ec565b50600760009054906101000a90046001600160a01b03166001600160a01b0316639c47ee3b6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156116b657600080fd5b505af11580156116ca573d6000803e3d6000fd5b5050505080600014156116dd5750611751565b6007546001600160a01b03166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561173757600080fd5b505af115801561174b573d6000803e3d6000fd5b50505050505b50506001805550565b6000546001600160a01b031633146117845760405162461bcd60e51b81526004016103ee90612a3d565b6001600160a01b0381166117e95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103ee565b6104d181611c08565b60025460ff16156118155760405162461bcd60e51b81526004016103ee90612a13565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861184a3390565b6040516001600160a01b03909116815260200160405180910390a1565b60025460ff166118b05760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016103ee565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa3361184a565b60025460ff16156119045760405162461bcd60e51b81526004016103ee90612a13565b6b094e47b8d681715340000000600f541015611973576201518069028a857425466f8000006004546010544261193a9190612b2c565b6119449190612b0d565b61194e9190612b0d565b6119589190612af9565b600f60008282546119699190612ae1565b9091555050426010555b6040805160608101825261ffff80841682526001600160501b0342811660208085019182526001600160a01b03808916868801908152600089815260099093529682209551865493519751909116600160601b026001600160601b039790941662010000026001600160601b031990931694169390931717939093169290921790556004805460019290611a08908490612ae1565b909155505060405142815260019082906001600160a01b038516907f8612e8567c2b59ea0cd07546cc5fd09fdcb85f542e6d73367c39b009ce24a0bf9060200160405180910390a45050565b6000611a5f82611b6b565b90508060ff1660036000828254611a769190612ae1565b909155505060ff81166000908152600a602081815260408084208054878652600b8452828620819055938352815160608101835261ffff8089168252600d80546001600160501b039081168488019081526001600160a01b03808e1686890181815260018c018955978c52988b20955195909901805491519651909916600160601b026001600160601b039690921662010000026001600160601b031990911694909316939093179190911792909216179093559154915185927f8612e8567c2b59ea0cd07546cc5fd09fdcb85f542e6d73367c39b009ce24a0bf91611b5e91815260200190565b60405180910390a4505050565b6005546040516394e5684760e01b81526004810183905260009182916001600160a01b03909116906394e56847906024016101406040518083038186803b158015611bb557600080fd5b505afa158015611bc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bed919061289f565b90508061012001516008611c019190612b43565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008281526009602090815260408083208151606081018352905461ffff811682526201000081046001600160501b031693820193909352600160601b9092046001600160a01b03169082018190523314611cf55760405162461bcd60e51b815260206004820152601960248201527f446f6e2774206f776e2074686520676976656e20746f6b656e0000000000000060448201526064016103ee565b828015611d1c57506202a30081602001516001600160501b031642611d1a9190612b2c565b105b15611d695760405162461bcd60e51b815260206004820152601860248201527f5374696c6c206775617264696e672074686520746f776572000000000000000060448201526064016103ee565b6b094e47b8d681715340000000600f541015611dc2576201518069028a857425466f80000082602001516001600160501b031642611da79190612b2c565b611db19190612b0d565b611dbb9190612af9565b9150611e23565b60105481602001516001600160501b03161115611de25760009150611e23565b6201518069028a857425466f80000082602001516001600160501b0316601054611e0c9190612b2c565b611e169190612b0d565b611e209190612af9565b91505b8215611f5c57600860009054906101000a90046001600160a01b03166001600160a01b0316635ec01e4d6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611e7957600080fd5b505af1158015611e8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eb191906129a0565b60011660011415611eca57611ec58261258e565b600091505b60008481526009602052604081208190556004805460019290611eee908490612b2c565b90915550506005546001600160a01b031663b88d4fde3033876040518463ffffffff1660e01b8152600401611f25939291906129e0565b600060405180830381600087803b158015611f3f57600080fd5b505af1158015611f53573d6000803e3d6000fd5b50505050612039565b611f7b6064611f6c601485612b0d565b611f769190612af9565b61258e565b6064611f88601482612b2c565b611f929084612b0d565b611f9c9190612af9565b915060405180606001604052808561ffff168152602001426001600160501b03168152602001611fc93390565b6001600160a01b0390811690915260008681526009602090815260409182902084518154928601519590930151909316600160601b026001600160601b036001600160501b0390951662010000026001600160601b031990921661ffff9093169290921717929092169190911790555b821515847f569d2442a75622c2ebdc65c793086aa6cc5e3917a5ed712538a06b60ed0548d08460405161206e91815260200190565b60405180910390a35092915050565b6005546040516331a9108f60e11b81526004810184905260009130916001600160a01b0390911690636352211e9060240160206040518083038186803b1580156120c657600080fd5b505afa1580156120da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120fe919061266e565b6001600160a01b0316146121485760405162461bcd60e51b81526020600482015260116024820152702237b2b9b713ba1037bbb7103a37b5b2b760791b60448201526064016103ee565b600061215384611b6b565b90506000600a60008360ff168152602001908152602001600020600b6000878152602001908152602001600020548154811061219f57634e487b7160e01b600052603260045260246000fd5b600091825260209182902060408051606081018252929091015461ffff811683526201000081046001600160501b031693830193909352600160601b9092046001600160a01b0316918101829052915033146122315760405162461bcd60e51b81526020600482015260116024820152702237b2b9b713ba1037bbb7103a37b5b2b760791b60448201526064016103ee565b80602001516001600160501b0316600d5461224c9190612b2c565b6122599060ff8416612b0d565b9250831561246b578160ff16600360008282546122769190612b2c565b909155505060ff82166000908152600a60205260408120805461229b90600190612b2c565b815481106122b957634e487b7160e01b600052603260045260246000fd5b6000918252602080832060408051606081018252939091015461ffff811684526201000081046001600160501b031684840152600160601b90046001600160a01b03168382015260ff87168452600a82528084208a8552600b909252909220548254919350839291811061233d57634e487b7160e01b600052603260045260246000fd5b60009182526020808320845192018054858301516040968701516001600160a01b0316600160601b026001600160601b036001600160501b0390921662010000026001600160601b031990931661ffff968716179290921716179055898352600b815283832054855190921683528383209190915560ff86168252600a9052208054806123da57634e487b7160e01b600052603160045260246000fd5b600082815260208082206000199084018101839055909201909255878252600b905260408120556005546001600160a01b031663b88d4fde3033896040518463ffffffff1660e01b8152600401612433939291906129e0565b600060405180830381600087803b15801561244d57600080fd5b505af1158015612461573d6000803e3d6000fd5b5050505050612549565b60405180606001604052808661ffff168152602001600d546001600160501b031681526020016124983390565b6001600160a01b0316905260ff83166000908152600a60209081526040808320898452600b90925290912054815481106124e257634e487b7160e01b600052603260045260246000fd5b6000918252602091829020835191018054928401516040909401516001600160a01b0316600160601b026001600160601b036001600160501b0390951662010000026001600160601b031990941661ffff9093169290921792909217929092169190911790555b831515857fc8a6b99877b30d5222ab2ba9b95286368a0257f79d4627be93478b3c57ca60cd8560405161257e91815260200190565b60405180910390a3505092915050565b6003546125af5780600c60008282546125a79190612ae1565b909155505050565b600354600c546125bf9083612ae1565b6125c99190612af9565b600d60008282546125da9190612ae1565b90915550506000600c5550565b60008083601f8401126125f8578182fd5b50813567ffffffffffffffff81111561260f578182fd5b6020830191508360208260051b850101111561262a57600080fd5b9250929050565b805161263c81612bd6565b919050565b805160ff8116811461263c57600080fd5b600060208284031215612663578081fd5b8135611c0181612bc1565b60006020828403121561267f578081fd5b8151611c0181612bc1565b6000806000806080858703121561269f578283fd5b84356126aa81612bc1565b935060208501356126ba81612bc1565b925060408501356126ca81612bc1565b915060608501356126da81612bc1565b939692955090935050565b6000806000806000608086880312156126fc578081fd5b853561270781612bc1565b9450602086013561271781612bc1565b935060408601359250606086013567ffffffffffffffff8082111561273a578283fd5b818801915088601f83011261274d578283fd5b81358181111561275b578384fd5b89602082850101111561276c578384fd5b9699959850939650602001949392505050565b600080600060408486031215612793578283fd5b833561279e81612bc1565b9250602084013567ffffffffffffffff8111156127b9578283fd5b6127c5868287016125e7565b9497909650939450505050565b6000806000604084860312156127e6578283fd5b833567ffffffffffffffff8111156127fc578384fd5b612808868287016125e7565b909450925050602084013561281c81612bd6565b809150509250925092565b60008060208385031215612839578182fd5b823567ffffffffffffffff81111561284f578283fd5b61285b858286016125e7565b90969095509350505050565b600060208284031215612878578081fd5b8135611c0181612bd6565b600060208284031215612894578081fd5b8151611c0181612bd6565b600061014082840312156128b1578081fd5b6128b9612aa9565b6128c283612631565b81526128d060208401612641565b60208201526128e160408401612641565b60408201526128f260608401612641565b606082015261290360808401612641565b608082015261291460a08401612641565b60a082015261292560c08401612641565b60c082015261293660e08401612641565b60e0820152610100612949818501612641565b9082015261012061295b848201612641565b908201529392505050565b600060208284031215612977578081fd5b813561ffff81168114611c01578182fd5b600060208284031215612999578081fd5b5035919050565b6000602082840312156129b1578081fd5b5051919050565b6000602082840312156129c9578081fd5b815167ffffffffffffffff81168114611c01578182fd5b6001600160a01b039384168152919092166020820152604081019190915260806060820181905260009082015260a00190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b604051610140810167ffffffffffffffff81118282101715612adb57634e487b7160e01b600052604160045260246000fd5b60405290565b60008219821115612af457612af4612b95565b500190565b600082612b0857612b08612bab565b500490565b6000816000190483118215151615612b2757612b27612b95565b500290565b600082821015612b3e57612b3e612b95565b500390565b600060ff821660ff841680821015612b5d57612b5d612b95565b90039392505050565b6000600019821415612b7a57612b7a612b95565b5060010190565b600082612b9057612b90612bab565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b03811681146104d157600080fd5b80151581146104d157600080fdfea2646970667358221220bed556ffbd7f033aae40ddb62a68f363a99b0c3def65d11d4866b09b5004638164736f6c63430008040033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638da5cb5b116100de578063d3ea435011610097578063e74c6bb511610071578063e74c6bb514610357578063f10fb58414610360578063f2fde38b14610373578063f8b2a46e1461038657600080fd5b8063d3ea43501461031e578063da7f5c8e14610331578063e12b635b1461034457600080fd5b80638da5cb5b146102b45780639e3bcb8d146102c5578063a2f47a66146102df578063bf989b6e146102f0578063ce6c121814610303578063d121e7651461030b57600080fd5b80635c975abb1161014b5780636f7bb00a116101255780636f7bb00a1461025b578063715018a614610286578063765310081461028e5780638336a6cf146102a157600080fd5b80635c975abb1461022a57806362bd92ae146102355780636a3ef0571461024857600080fd5b80630530587514610193578063150b7a02146101af57806316c38b3c146101db5780631f4fb37a146101f057806337a386b91461020357806339db714f1461020d575b600080fd5b61019c600f5481565b6040519081526020015b60405180910390f35b6101c26101bd3660046126e5565b610399565b6040516001600160e01b031990911681526020016101a6565b6101ee6101e9366004612867565b610409565b005b6101ee6101fe366004612988565b6104dc565b61019c6202a30081565b60115461021a9060ff1681565b60405190151581526020016101a6565b60025460ff1661021a565b6101ee61024336600461277f565b61050b565b6101ee610256366004612827565b610975565b60075461026e906001600160a01b031681565b6040516001600160a01b0390911681526020016101a6565b6101ee610f6e565b6101ee61029c366004612867565b610fa4565b61026e6102af366004612988565b610fe1565b6000546001600160a01b031661026e565b6102cd600881565b60405160ff90911681526020016101a6565b61019c69028a857425466f80000081565b6101ee6102fe36600461268a565b6110de565b61019c601481565b61019c6b094e47b8d68171534000000081565b61019c61032c366004612988565b611158565b6101ee61033f3660046127d2565b6113d6565b60065461026e906001600160a01b031681565b61019c600e5481565b60085461026e906001600160a01b031681565b6101ee610381366004612652565b61175a565b60055461026e906001600160a01b031681565b60006001600160a01b038516156103f75760405162461bcd60e51b815260206004820152601d60248201527f43616e6e6f742073656e6420746f20546f776572206469726563746c7900000060448201526064015b60405180910390fd5b50630a85bd0160e11b95945050505050565b6005546001600160a01b03161580159061042d57506007546001600160a01b031615155b801561044357506006546001600160a01b031615155b801561045957506008546001600160a01b031615155b6104995760405162461bcd60e51b815260206004820152601160248201527010dbdb9d1c9858dd1cc81b9bdd081cd95d607a1b60448201526064016103ee565b6000546001600160a01b031633146104c35760405162461bcd60e51b81526004016103ee90612a3d565b80156104d4576104d16117f2565b50565b6104d1611867565b6000546001600160a01b031633146105065760405162461bcd60e51b81526004016103ee90612a3d565b600e55565b6002600154141561052e5760405162461bcd60e51b81526004016103ee90612a72565b60026001553233148061055457506006546001600160a01b0316336001600160a01b0316145b61058b5760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920454f4160c01b60448201526064016103ee565b6001600160a01b03831632146105e35760405162461bcd60e51b815260206004820152601a60248201527f6163636f756e7420746f2073656e646572206d69736d6174636800000000000060448201526064016103ee565b60005b8181101561096b576006546001600160a01b0316336001600160a01b0316146107d15760055433906001600160a01b0316636352211e85858581811061063c57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106519190612966565b6040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b15801561068b57600080fd5b505afa15801561069f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c3919061266e565b6001600160a01b0316146107195760405162461bcd60e51b815260206004820152601860248201527f596f7520646f6e2774206f776e207468697320746f6b656e000000000000000060448201526064016103ee565b6005546001600160a01b03166323b872dd333086868681811061074c57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906107619190612966565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015261ffff166044820152606401600060405180830381600087803b1580156107b457600080fd5b505af11580156107c8573d6000803e3d6000fd5b50505050610813565b8282828181106107f157634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108069190612966565b61ffff1661081357610959565b6005546001600160a01b031663ff53f47384848481811061084457634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108599190612966565b6040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b15801561089357600080fd5b505afa1580156108a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cb9190612883565b1561091757610912848484848181106108f457634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109099190612966565b61ffff166118e1565b610959565b6109598484848481811061093b57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109509190612966565b61ffff16611a54565b8061096381612b66565b9150506105e6565b5050600180555050565b600260015414156109985760405162461bcd60e51b81526004016103ee90612a72565b600260015560115460ff166109e15760405162461bcd60e51b815260206004820152600f60248201526e149154d0d55148111254d050931151608a1b60448201526064016103ee565b60408051606080820183526000808352602080840182905283850182905284519283018552818352820181905292810183905282805b85811015610f6157868682818110610a3f57634e487b7160e01b600052603260045260246000fd5b600554604051600162ac0b8d60e01b0319815260209290920293909301356004820181905297506001600160a01b039092169163ff53f473915060240160206040518083038186803b158015610a9457600080fd5b505afa158015610aa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acc9190612883565b15610c31576000858152600960209081526040918290208251606081018452905461ffff811682526201000081046001600160501b031692820192909252600160601b9091046001600160a01b031691810182905294503314610b665760405162461bcd60e51b81526020600482015260126024820152715357495045522c204e4f2053574950494e4760701b60448201526064016103ee565b60008581526009602052604081208190556004805460019290610b8a908490612b2c565b90915550506005546001600160a01b031663b88d4fde3033886040518463ffffffff1660e01b8152600401610bc1939291906129e0565b600060405180830381600087803b158015610bdb57600080fd5b505af1158015610bef573d6000803e3d6000fd5b505060405160008152600192508791507f569d2442a75622c2ebdc65c793086aa6cc5e3917a5ed712538a06b60ed0548d09060200160405180910390a3610f4f565b610c3a85611b6b565b60ff81166000908152600a60209081526040808320898452600b90925290912054815492945090918110610c7e57634e487b7160e01b600052603260045260246000fd5b600091825260209182902060408051606081018252929091015461ffff811683526201000081046001600160501b031693830193909352600160601b9092046001600160a01b031691810182905294503314610d115760405162461bcd60e51b81526020600482015260126024820152715357495045522c204e4f2053574950494e4760701b60448201526064016103ee565b8160ff1660036000828254610d269190612b2c565b909155505060ff82166000908152600a602052604090208054610d4b90600190612b2c565b81548110610d6957634e487b7160e01b600052603260045260246000fd5b6000918252602080832060408051606081018252939091015461ffff811684526201000081046001600160501b031684840152600160601b90046001600160a01b03168382015260ff86168452600a8252808420898552600b9092529092205482549195508592918110610ded57634e487b7160e01b600052603260045260246000fd5b60009182526020808320845192018054858301516040968701516001600160a01b0316600160601b026001600160601b036001600160501b0390921662010000026001600160601b031990931661ffff968716179290921716179055888352600b815283832054875190921683528383209190915560ff85168252600a905220805480610e8a57634e487b7160e01b600052603160045260246000fd5b600082815260208082206000199084018101839055909201909255868252600b905260408120556005546001600160a01b031663b88d4fde3033886040518463ffffffff1660e01b8152600401610ee3939291906129e0565b600060405180830381600087803b158015610efd57600080fd5b505af1158015610f11573d6000803e3d6000fd5b505060405160008152600192508791507fc8a6b99877b30d5222ab2ba9b95286368a0257f79d4627be93478b3c57ca60cd9060200160405180910390a35b80610f5981612b66565b915050610a17565b5050600180555050505050565b6000546001600160a01b03163314610f985760405162461bcd60e51b81526004016103ee90612a3d565b610fa26000611c08565b565b6000546001600160a01b03163314610fce5760405162461bcd60e51b81526004016103ee90612a3d565b6011805460ff1916911515919091179055565b600060035460001415610ff657506000919050565b60006003548363ffffffff1661100c9190612b81565b60209390931c92905060008061102460036008612b43565b60ff1690505b600881116110d3576000818152600a602052604090205461104c908290612b0d565b6110569083612ae1565b9150818310611064576110c1565b6000818152600a60205260409020805461107e9087612b81565b8154811061109c57634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600160601b90046001600160a01b031695945050505050565b806110cb81612b66565b91505061102a565b506000949350505050565b6000546001600160a01b031633146111085760405162461bcd60e51b81526004016103ee90612a3d565b600580546001600160a01b039586166001600160a01b0319918216179091556007805494861694821694909417909355600680549285169284169290921790915560088054919093169116179055565b600554604051631d7a2e6d60e31b81526004810183905260009182916001600160a01b039091169063ebd173689060240160206040518083038186803b1580156111a157600080fd5b505afa1580156111b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d991906129b8565b9050438167ffffffffffffffff16106112285760405162461bcd60e51b8152602060048201526011602482015270686d6d6d6d207768617420646f696e673f60781b60448201526064016103ee565b6000838152600960209081526040918290208251606081018452905461ffff811682526201000081046001600160501b031692820192909252600160601b9091046001600160a01b03908116828401526005549251600162ac0b8d60e01b03198152600481018790529192169063ff53f4739060240160206040518083038186803b1580156112b657600080fd5b505afa1580156112ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ee9190612883565b15611396576b094e47b8d681715340000000600f54101561134c576201518069028a857425466f80000082602001516001600160501b0316426113319190612b2c565b61133b9190612b0d565b6113459190612af9565b92506113cf565b60105481602001516001600160501b0316111561136c57600092506113cf565b6201518069028a857425466f80000082602001516001600160501b03166010546113319190612b2c565b60006113a185611b6b565b905081602001516001600160501b0316600d546113be9190612b2c565b6113cb9060ff8316612b0d565b9350505b5050919050565b60025460ff16156113f95760405162461bcd60e51b81526004016103ee90612a13565b6b094e47b8d681715340000000600f541015611468576201518069028a857425466f8000006004546010544261142f9190612b2c565b6114399190612b0d565b6114439190612b0d565b61144d9190612af9565b600f600082825461145e9190612ae1565b9091555050426010555b6002600154141561148b5760405162461bcd60e51b81526004016103ee90612a72565b6002600155323314806114b157506006546001600160a01b0316336001600160a01b0316145b6114e85760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920454f4160c01b60448201526064016103ee565b6000805b83811015611665576005546001600160a01b031663ff53f47386868481811061152557634e487b7160e01b600052603260045260246000fd5b905060200201602081019061153a9190612966565b6040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b15801561157457600080fd5b505afa158015611588573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ac9190612883565b15611604576115f38585838181106115d457634e487b7160e01b600052603260045260246000fd5b90506020020160208101906115e99190612966565b61ffff1684611c58565b6115fd9083612ae1565b9150611653565b61164685858381811061162757634e487b7160e01b600052603260045260246000fd5b905060200201602081019061163c9190612966565b61ffff168461207d565b6116509083612ae1565b91505b8061165d81612b66565b9150506114ec565b50600760009054906101000a90046001600160a01b03166001600160a01b0316639c47ee3b6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156116b657600080fd5b505af11580156116ca573d6000803e3d6000fd5b5050505080600014156116dd5750611751565b6007546001600160a01b03166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561173757600080fd5b505af115801561174b573d6000803e3d6000fd5b50505050505b50506001805550565b6000546001600160a01b031633146117845760405162461bcd60e51b81526004016103ee90612a3d565b6001600160a01b0381166117e95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103ee565b6104d181611c08565b60025460ff16156118155760405162461bcd60e51b81526004016103ee90612a13565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861184a3390565b6040516001600160a01b03909116815260200160405180910390a1565b60025460ff166118b05760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016103ee565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa3361184a565b60025460ff16156119045760405162461bcd60e51b81526004016103ee90612a13565b6b094e47b8d681715340000000600f541015611973576201518069028a857425466f8000006004546010544261193a9190612b2c565b6119449190612b0d565b61194e9190612b0d565b6119589190612af9565b600f60008282546119699190612ae1565b9091555050426010555b6040805160608101825261ffff80841682526001600160501b0342811660208085019182526001600160a01b03808916868801908152600089815260099093529682209551865493519751909116600160601b026001600160601b039790941662010000026001600160601b031990931694169390931717939093169290921790556004805460019290611a08908490612ae1565b909155505060405142815260019082906001600160a01b038516907f8612e8567c2b59ea0cd07546cc5fd09fdcb85f542e6d73367c39b009ce24a0bf9060200160405180910390a45050565b6000611a5f82611b6b565b90508060ff1660036000828254611a769190612ae1565b909155505060ff81166000908152600a602081815260408084208054878652600b8452828620819055938352815160608101835261ffff8089168252600d80546001600160501b039081168488019081526001600160a01b03808e1686890181815260018c018955978c52988b20955195909901805491519651909916600160601b026001600160601b039690921662010000026001600160601b031990911694909316939093179190911792909216179093559154915185927f8612e8567c2b59ea0cd07546cc5fd09fdcb85f542e6d73367c39b009ce24a0bf91611b5e91815260200190565b60405180910390a4505050565b6005546040516394e5684760e01b81526004810183905260009182916001600160a01b03909116906394e56847906024016101406040518083038186803b158015611bb557600080fd5b505afa158015611bc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bed919061289f565b90508061012001516008611c019190612b43565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008281526009602090815260408083208151606081018352905461ffff811682526201000081046001600160501b031693820193909352600160601b9092046001600160a01b03169082018190523314611cf55760405162461bcd60e51b815260206004820152601960248201527f446f6e2774206f776e2074686520676976656e20746f6b656e0000000000000060448201526064016103ee565b828015611d1c57506202a30081602001516001600160501b031642611d1a9190612b2c565b105b15611d695760405162461bcd60e51b815260206004820152601860248201527f5374696c6c206775617264696e672074686520746f776572000000000000000060448201526064016103ee565b6b094e47b8d681715340000000600f541015611dc2576201518069028a857425466f80000082602001516001600160501b031642611da79190612b2c565b611db19190612b0d565b611dbb9190612af9565b9150611e23565b60105481602001516001600160501b03161115611de25760009150611e23565b6201518069028a857425466f80000082602001516001600160501b0316601054611e0c9190612b2c565b611e169190612b0d565b611e209190612af9565b91505b8215611f5c57600860009054906101000a90046001600160a01b03166001600160a01b0316635ec01e4d6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611e7957600080fd5b505af1158015611e8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eb191906129a0565b60011660011415611eca57611ec58261258e565b600091505b60008481526009602052604081208190556004805460019290611eee908490612b2c565b90915550506005546001600160a01b031663b88d4fde3033876040518463ffffffff1660e01b8152600401611f25939291906129e0565b600060405180830381600087803b158015611f3f57600080fd5b505af1158015611f53573d6000803e3d6000fd5b50505050612039565b611f7b6064611f6c601485612b0d565b611f769190612af9565b61258e565b6064611f88601482612b2c565b611f929084612b0d565b611f9c9190612af9565b915060405180606001604052808561ffff168152602001426001600160501b03168152602001611fc93390565b6001600160a01b0390811690915260008681526009602090815260409182902084518154928601519590930151909316600160601b026001600160601b036001600160501b0390951662010000026001600160601b031990921661ffff9093169290921717929092169190911790555b821515847f569d2442a75622c2ebdc65c793086aa6cc5e3917a5ed712538a06b60ed0548d08460405161206e91815260200190565b60405180910390a35092915050565b6005546040516331a9108f60e11b81526004810184905260009130916001600160a01b0390911690636352211e9060240160206040518083038186803b1580156120c657600080fd5b505afa1580156120da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120fe919061266e565b6001600160a01b0316146121485760405162461bcd60e51b81526020600482015260116024820152702237b2b9b713ba1037bbb7103a37b5b2b760791b60448201526064016103ee565b600061215384611b6b565b90506000600a60008360ff168152602001908152602001600020600b6000878152602001908152602001600020548154811061219f57634e487b7160e01b600052603260045260246000fd5b600091825260209182902060408051606081018252929091015461ffff811683526201000081046001600160501b031693830193909352600160601b9092046001600160a01b0316918101829052915033146122315760405162461bcd60e51b81526020600482015260116024820152702237b2b9b713ba1037bbb7103a37b5b2b760791b60448201526064016103ee565b80602001516001600160501b0316600d5461224c9190612b2c565b6122599060ff8416612b0d565b9250831561246b578160ff16600360008282546122769190612b2c565b909155505060ff82166000908152600a60205260408120805461229b90600190612b2c565b815481106122b957634e487b7160e01b600052603260045260246000fd5b6000918252602080832060408051606081018252939091015461ffff811684526201000081046001600160501b031684840152600160601b90046001600160a01b03168382015260ff87168452600a82528084208a8552600b909252909220548254919350839291811061233d57634e487b7160e01b600052603260045260246000fd5b60009182526020808320845192018054858301516040968701516001600160a01b0316600160601b026001600160601b036001600160501b0390921662010000026001600160601b031990931661ffff968716179290921716179055898352600b815283832054855190921683528383209190915560ff86168252600a9052208054806123da57634e487b7160e01b600052603160045260246000fd5b600082815260208082206000199084018101839055909201909255878252600b905260408120556005546001600160a01b031663b88d4fde3033896040518463ffffffff1660e01b8152600401612433939291906129e0565b600060405180830381600087803b15801561244d57600080fd5b505af1158015612461573d6000803e3d6000fd5b5050505050612549565b60405180606001604052808661ffff168152602001600d546001600160501b031681526020016124983390565b6001600160a01b0316905260ff83166000908152600a60209081526040808320898452600b90925290912054815481106124e257634e487b7160e01b600052603260045260246000fd5b6000918252602091829020835191018054928401516040909401516001600160a01b0316600160601b026001600160601b036001600160501b0390951662010000026001600160601b031990941661ffff9093169290921792909217929092169190911790555b831515857fc8a6b99877b30d5222ab2ba9b95286368a0257f79d4627be93478b3c57ca60cd8560405161257e91815260200190565b60405180910390a3505092915050565b6003546125af5780600c60008282546125a79190612ae1565b909155505050565b600354600c546125bf9083612ae1565b6125c99190612af9565b600d60008282546125da9190612ae1565b90915550506000600c5550565b60008083601f8401126125f8578182fd5b50813567ffffffffffffffff81111561260f578182fd5b6020830191508360208260051b850101111561262a57600080fd5b9250929050565b805161263c81612bd6565b919050565b805160ff8116811461263c57600080fd5b600060208284031215612663578081fd5b8135611c0181612bc1565b60006020828403121561267f578081fd5b8151611c0181612bc1565b6000806000806080858703121561269f578283fd5b84356126aa81612bc1565b935060208501356126ba81612bc1565b925060408501356126ca81612bc1565b915060608501356126da81612bc1565b939692955090935050565b6000806000806000608086880312156126fc578081fd5b853561270781612bc1565b9450602086013561271781612bc1565b935060408601359250606086013567ffffffffffffffff8082111561273a578283fd5b818801915088601f83011261274d578283fd5b81358181111561275b578384fd5b89602082850101111561276c578384fd5b9699959850939650602001949392505050565b600080600060408486031215612793578283fd5b833561279e81612bc1565b9250602084013567ffffffffffffffff8111156127b9578283fd5b6127c5868287016125e7565b9497909650939450505050565b6000806000604084860312156127e6578283fd5b833567ffffffffffffffff8111156127fc578384fd5b612808868287016125e7565b909450925050602084013561281c81612bd6565b809150509250925092565b60008060208385031215612839578182fd5b823567ffffffffffffffff81111561284f578283fd5b61285b858286016125e7565b90969095509350505050565b600060208284031215612878578081fd5b8135611c0181612bd6565b600060208284031215612894578081fd5b8151611c0181612bd6565b600061014082840312156128b1578081fd5b6128b9612aa9565b6128c283612631565b81526128d060208401612641565b60208201526128e160408401612641565b60408201526128f260608401612641565b606082015261290360808401612641565b608082015261291460a08401612641565b60a082015261292560c08401612641565b60c082015261293660e08401612641565b60e0820152610100612949818501612641565b9082015261012061295b848201612641565b908201529392505050565b600060208284031215612977578081fd5b813561ffff81168114611c01578182fd5b600060208284031215612999578081fd5b5035919050565b6000602082840312156129b1578081fd5b5051919050565b6000602082840312156129c9578081fd5b815167ffffffffffffffff81168114611c01578182fd5b6001600160a01b039384168152919092166020820152604081019190915260806060820181905260009082015260a00190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b604051610140810167ffffffffffffffff81118282101715612adb57634e487b7160e01b600052604160045260246000fd5b60405290565b60008219821115612af457612af4612b95565b500190565b600082612b0857612b08612bab565b500490565b6000816000190483118215151615612b2757612b27612b95565b500290565b600082821015612b3e57612b3e612b95565b500390565b600060ff821660ff841680821015612b5d57612b5d612b95565b90039392505050565b6000600019821415612b7a57612b7a612b95565b5060010190565b600082612b9057612b90612bab565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b03811681146104d157600080fd5b80151581146104d157600080fdfea2646970667358221220bed556ffbd7f033aae40ddb62a68f363a99b0c3def65d11d4866b09b5004638164736f6c63430008040033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

OVERVIEW

Contract of Wizards & Dragons's Tower V1

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.