ETH Price: $2,530.91 (-18.23%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AstroStakingControllerV3

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 11 : AstroStakingControllerV3.sol
// SPDX-License-Identifier: MIT
//.___________. __  .__   __. ____    ____      ___           _______..___________..______        ______
//|           ||  | |  \ |  | \   \  /   /     /   \         /       ||           ||   _  \      /  __  \
//`---|  |----`|  | |   \|  |  \   \/   /     /  ^  \       |   (----``---|  |----`|  |_)  |    |  |  |  |
//    |  |     |  | |  . `  |   \_    _/     /  /_\  \       \   \        |  |     |      /     |  |  |  |
//    |  |     |  | |  |\   |     |  |      /  _____  \  .----)   |       |  |     |  |\  \----.|  `--'  |
//    |__|     |__| |__| \__|     |__|     /__/     \__\ |_______/        |__|     | _| `._____| \______/

pragma solidity ^0.8.15;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "./interfaces/IEmissionRateManager.sol";

// Minimum ERC721 & ERC20 interface
interface IERC721 {
  function ownerOf(uint256 tokenId) external view returns (address owner);

  function balanceOf(address owner) external view returns (uint256 balance);
}

interface IERC20 {
  function mint(address to, uint256 amount) external;
}

contract AstroStakingControllerV3 is Initializable, UUPSUpgradeable, OwnableUpgradeable {
  // Data related to staked NFT tokens
  struct StakedToken {
    // Owner of the NFT
    address owner;
    // Timestamp when the NFT was staked
    uint32 timestamp;
    // Flag indicating whether it's the first staked NFT
    // First staked NFT cannot be unstaked unless all other NFTs are unstaked
    // First staked NFT will only get one rental pass
    bool isFirstStaked;
    // Rental recipients and expirations
    address recipient1;
    uint32 expiration1;
    address recipient2;
    uint32 expiration2;
  }

  // Data related to token owners
  struct TokenOwner {
    // Token ids of currently staked NFT
    uint256[] stakedTokenIds;
    // Total amount of ERC20 tokens minted by the address
    uint256 amountMinted;
  }

  // Events
  event Staked(address indexed owner, uint256 indexed tokenId, bool isFirstStaked);

  event Unstaked(address indexed owner, uint256 indexed tokenId, uint256 amountMinted);

  event Claimed(address indexed owner, uint256 amountMinted);

  event Rented(
    address indexed owner,
    address indexed recipient,
    uint256 indexed tokenId,
    bool isFirstPass,
    uint32 expiration
  );

  // Contract address of TinyAstro NFT
  address public tinyAstro;

  // Contract address of AstroToken
  address public astroToken;

  // Contract address of EmissionRateManager
  address public emissionRateManager;

  bool public isPaused;

  bool public isMintingPaused;

  // Mapping token id to rarity
  mapping(uint256 => uint256) public tokenRarities;

  // Valid rental durations (in days)
  mapping(uint256 => bool) public rentalDurations;

  // Mapping token id to staked data
  mapping(uint256 => StakedToken) public stakedTokens;

  // Mapping owner address to address data
  mapping(address => TokenOwner) public tokenOwners;

  // Mapping rental recipient address to token id
  mapping(address => uint256) private _recipientToTokenId;

  /// @custom:oz-upgrades-unsafe-allow constructor
  constructor() initializer {}

  function initialize(address _tinyAstro, address _astroToken, address _emissionRateManager) public virtual initializer {
    tinyAstro = _tinyAstro;
    astroToken = _astroToken;
    emissionRateManager = _emissionRateManager;
    isPaused = true;

    // Add rental durations of 1 day, 14 days and 30 days
    rentalDurations[1] = true;
    rentalDurations[14] = true;
    rentalDurations[30] = true;

    __Ownable_init();
  }

  function setPaused(bool status) external onlyOwner {
    isPaused = status;
  }

  function setMintingPaused(bool status) external onlyOwner {
    isMintingPaused = status;
  }

  function setEmissionRateManager(address addr) external onlyOwner {
    emissionRateManager = addr;
  }

  function updateTokenRarity(uint256 rarity, uint256[] calldata tokenIds) external onlyOwner {
    unchecked {
      for (uint256 i = 0; i < tokenIds.length; i++) {
        tokenRarities[tokenIds[i]] = rarity;
      }
    }
  }

  function updateRentalDurations(uint256[] calldata toAdd, uint256[] calldata toRemove) external onlyOwner {
    unchecked {
      for (uint256 i = 0; i < toAdd.length; i++) {
        rentalDurations[toAdd[i]] = true;
      }

      for (uint256 i = 0; i < toRemove.length; i++) {
        delete rentalDurations[toRemove[i]];
      }
    }
  }
  modifier whenNotPaused() {
    require(!isPaused, "Contract is paused");
    _;
  }

  /**
   * @notice NFT holders use this function to stake their tokens.
   * @dev Emission rate is set at the time of staking.
   *      Future changes of the corresponding multiplier will not apply to staked tokens.
   *      Staked NFT tokens are blocked from transfers.
   * @param tokenIds List of token id to be staked.
   */
  function stake(uint256[] calldata tokenIds) external whenNotPaused {
    unchecked {
      for (uint256 i = 0; i < tokenIds.length; i++) {
        _stake(tokenIds[i]);
      }
    }
  }

  function _stake(uint256 tokenId) internal {
    require(IERC721(tinyAstro).ownerOf(tokenId) == msg.sender, "Not the token owner");

    StakedToken storage stakedToken = stakedTokens[tokenId];
    require(stakedToken.owner == address(0), "Token is already staked");

    stakedToken.owner = msg.sender;
    stakedToken.timestamp = uint32(block.timestamp);

    uint256[] storage stakedTokenIds = tokenOwners[msg.sender].stakedTokenIds;
    stakedToken.isFirstStaked = stakedTokenIds.length == 0;
    stakedTokenIds.push(tokenId);

    emit Staked(msg.sender, tokenId, stakedToken.isFirstStaked);
  }

  /**
   * @notice NFT token holders use this function to unstake their tokens and mint ERC20 tokens for rewards.
   * @dev First staked NFT can't be unstaked unless all other NFTs are unstaked.
   * @param tokenIds NFT tokens to be unstaked.
   */
  function unstake(uint256[] calldata tokenIds) external whenNotPaused {
    require(tokenIds.length > 0, "Empty token ids");

    TokenOwner storage tokenOwner = tokenOwners[msg.sender];
    require(tokenOwner.stakedTokenIds.length > 0, "No staked tokens");

    // Ensure first token is not unstaked unless no more staked tokens
    bool validatesFirstToken = tokenIds.length < tokenOwner.stakedTokenIds.length;
    uint256 amountToMint = 0;

    unchecked {
      for (uint256 i = 0; i < tokenIds.length; i++) {
        amountToMint += _unstake(tokenIds[i], true);
      }

      if (validatesFirstToken) {
        require(stakedTokens[tokenOwner.stakedTokenIds[0]].isFirstStaked, "First token cannot be unstaked yet");
      }

      if (amountToMint > 0) {
        IERC20(astroToken).mint(msg.sender, amountToMint);
        tokenOwner.amountMinted += amountToMint;
      }
    }
  }

  function adminUnstake(address owner, uint256[] calldata tokenIds) external onlyOwner {
    require(tokenIds.length > 0, "Empty token ids");

    TokenOwner storage tokenOwner = tokenOwners[owner];
    require(tokenOwner.stakedTokenIds.length > 0, "No staked tokens");

    // Ensure first token is not unstaked unless no more staked tokens
    bool validatesFirstToken = tokenIds.length < tokenOwner.stakedTokenIds.length;
    uint256 amountToMint = 0;

    unchecked {
      for (uint256 i = 0; i < tokenIds.length; i++) {
        amountToMint += _unstake(tokenIds[i], false);
      }

      if (validatesFirstToken) {
        require(stakedTokens[tokenOwner.stakedTokenIds[0]].isFirstStaked, "First token cannot be unstaked yet");
      }

      if (amountToMint > 0) {
        IERC20(astroToken).mint(owner, amountToMint);
        tokenOwner.amountMinted += amountToMint;
      }
    }
  }

  function _unstake(uint256 tokenId, bool checkOwner) internal returns (uint256 amountToMint) {
    StakedToken memory stakedToken = stakedTokens[tokenId];

    if (checkOwner) {
      require(stakedToken.owner == msg.sender, "Not the token owner");
      // Check if there is any active rental pass
      require(
        stakedToken.expiration1 < block.timestamp && stakedToken.expiration2 < block.timestamp,
        "Unstake with active rental pass"
      );
    }

    if (!isMintingPaused) {
      (amountToMint, ) = IEmissionRateManager(emissionRateManager)
        .amountToMint(tokenRarities[tokenId], stakedToken.timestamp, _secondsPerDay());
    }

    // Free storage
    delete stakedTokens[tokenId];
    _removeStakedTokenId(stakedToken.owner, tokenId);

    emit Unstaked(stakedToken.owner, tokenId, amountToMint);
  }

  /**
   * @notice NFT token holders use this function to claim/mint the ERC20 tokens without unstaking.
   * @dev The amount of ERC20 tokens is calculated on a daily basis.
   */
  function claim() external whenNotPaused {
    require(!isMintingPaused, "Minting is paused");

    uint256[] memory tokenIds = tokenOwners[msg.sender].stakedTokenIds;
    require(tokenIds.length > 0, "No staked tokens");

    uint256 amountToMint = 0;

    unchecked {
      for (uint256 i = 0; i < tokenIds.length; i++) {
        uint256 tokenId = tokenIds[i];

        StakedToken storage stakedToken = stakedTokens[tokenId];

        require(stakedToken.owner == msg.sender, "Not the token owner");

        (uint256 amount, uint256 newTimestamp) = IEmissionRateManager(emissionRateManager)
          .amountToMint(tokenRarities[tokenId], stakedToken.timestamp, _secondsPerDay());

        if (amount > 0) {
          amountToMint += amount;
          stakedToken.timestamp = uint32(newTimestamp);
        }
      }

      require(amountToMint > 0, "Zero mint amount");

      IERC20(astroToken).mint(msg.sender, amountToMint);
      tokenOwners[msg.sender].amountMinted += amountToMint;

      emit Claimed(msg.sender, amountToMint);
    }
  }

  /**
   * @notice Owner can rent staked NFT to other users for a certian period time so that they will gain access to the analytics platform.
   * @dev First staked NFT only has a single rental pass, while others have two.
   * @param tokenId NFT token to be rented out, must be a staked token.
   * @param recipient Pass recipient, must not be a NFT owner or an active pass holder.
   * @param firstPass Flag indicating wheter to rent the first or the second pass.
   * @param duration Rent duration measured in number of days.
   */
  function rent(
    uint256 tokenId,
    address recipient,
    bool firstPass,
    uint256 duration
  ) external whenNotPaused {
    require(rentalDurations[duration], "Invalid duration");

    StakedToken storage stakedToken = stakedTokens[tokenId];
    require(stakedToken.owner == msg.sender, "Not the token owner");

    // Ensure recipient is not holding any active pass
    _verifyRentalRecipient(recipient);

    uint32 expiration = uint32(block.timestamp + duration * _secondsPerDay());

    if (firstPass) {
      require(stakedToken.expiration1 < block.timestamp, "Pass is rent to someone else");
      stakedToken.recipient1 = recipient;
      stakedToken.expiration1 = expiration;
    } else {
      require(!stakedToken.isFirstStaked && stakedToken.expiration2 < block.timestamp, "Pass is rent to someone else");
      stakedToken.recipient2 = recipient;
      stakedToken.expiration2 = expiration;
    }

    _recipientToTokenId[recipient] = tokenId;

    emit Rented(msg.sender, recipient, tokenId, firstPass, expiration);
  }

  /**
   * @notice Check a owner's staking status.
   * @dev `amountToMint` is calculated on a daily basis.
   */
  function stakingStatus(address addr)
    external
    view
    returns (
      uint256[] memory stakedTokenIds,
      uint256 dailyYield,
      uint256 amountToMint,
      uint256 amountMinted
    )
  {
    TokenOwner memory tokenOwner = tokenOwners[addr];
    stakedTokenIds = tokenOwner.stakedTokenIds;
    amountMinted = tokenOwner.amountMinted;

    if (!isMintingPaused) {
      unchecked {
        for (uint256 i = 0; i < stakedTokenIds.length; i++) {
          uint256 tokenId = stakedTokenIds[i];
          dailyYield += IEmissionRateManager(emissionRateManager)
            .currentEmissionRate(tokenRarities[tokenId]);

          (uint256 amount, ) = IEmissionRateManager(emissionRateManager)
            .amountToMint(tokenRarities[tokenId], stakedTokens[tokenId].timestamp, _secondsPerDay());

          amountToMint += amount;
        }
      }
    }
  }

  /**
   * @notice Check the rental status for a given owner address.
   */
  function rentalStatus(address addr)
    external
    view
    returns (
      uint256[] memory stakedTokenIds,
      address[] memory recipient1,
      address[] memory recipient2,
      uint32[] memory expiration1,
      uint32[] memory expiration2,
      bool[] memory isValid1,
      bool[] memory isValid2
    )
  {
    stakedTokenIds = tokenOwners[addr].stakedTokenIds;
    uint256 numStakedTokens = stakedTokenIds.length;

    recipient1 = new address[](numStakedTokens);
    recipient2 = new address[](numStakedTokens);

    expiration1 = new uint32[](numStakedTokens);
    expiration2 = new uint32[](numStakedTokens);

    isValid1 = new bool[](numStakedTokens);
    isValid2 = new bool[](numStakedTokens);

    for (uint256 i = 0; i < stakedTokenIds.length; ) {
      StakedToken memory stakedToken = stakedTokens[stakedTokenIds[i]];

      recipient1[i] = stakedToken.recipient1;
      recipient2[i] = stakedToken.recipient2;

      expiration1[i] = stakedToken.expiration1;
      expiration2[i] = stakedToken.expiration2;

      isValid1[i] = stakedToken.expiration1 >= block.timestamp;
      isValid2[i] = stakedToken.expiration2 >= block.timestamp;

      unchecked {
        i++;
      }
    }
  }

  /**
   * @notice Check the rental status for a given recipient address.
   */
  function rentalRecipientStatus(address recipient) external view returns (bool isValid, uint32 expiration) {
    uint256 tokenId = _recipientToTokenId[recipient];

    StakedToken memory stakedToken = stakedTokens[tokenId];
    if (stakedToken.recipient1 == recipient) {
      expiration = stakedToken.expiration1;
    } else if (stakedToken.recipient2 == recipient) {
      expiration = stakedToken.expiration2;
    }
    isValid = expiration >= block.timestamp;
  }

  /**
   * @notice Check whether a token is currently staked.
   * @dev This function is needed for `ILeaseController` interface conformance in the NFT contract.
   */
  function isTokenStaked(uint256 tokenId) external view returns (bool) {
    return stakedTokens[tokenId].owner != address(0);
  }

  /**
   * @notice Verify the recipient is not a NFT owner, and is not holding any active rental pass.
   */
  function _verifyRentalRecipient(address recipient) internal view {
    require(IERC721(tinyAstro).balanceOf(recipient) == 0, "Recipient is a NFT owner");

    StakedToken memory stakedToken = stakedTokens[_recipientToTokenId[recipient]];

    uint256 expiration;
    if (stakedToken.recipient1 == recipient) {
      expiration = stakedToken.expiration1;
    } else if (stakedToken.recipient2 == recipient) {
      expiration = stakedToken.expiration2;
    }
    require(expiration < block.timestamp, "Recipient is in possession of an active rental pass");
  }

  /**
   * @dev Remove a NFT token id from staked tokens.
   */
  function _removeStakedTokenId(address addr, uint256 tokenId) internal {
    uint256[] storage tokenIds = tokenOwners[addr].stakedTokenIds;

    unchecked {
      for (uint256 i = 0; i < tokenIds.length; i++) {
        if (tokenIds[i] == tokenId) {
          return _remove(tokenIds, i);
        }
      }
    }
  }

  /**
   * @dev Remove the element at given index in an array without preserving order.
   */
  function _remove(uint256[] storage tokenIds, uint256 index) internal {
    if (index < tokenIds.length - 1) {
      tokenIds[index] = tokenIds[tokenIds.length - 1];
    }
    tokenIds.pop();
  }

  /**
   * @dev Test contracts can override this function to speed up the process.
   */
  function _secondsPerDay() internal view virtual returns (uint256) {
    return 1 days;
  }

  /**
   * @dev Required by UUPS upgradeable proxy
   */
  function _authorizeUpgrade(address) internal override onlyOwner {}
}

File 2 of 11 : IEmissionRateManager.sol
// SPDX-License-Identifier: MIT
//.___________. __  .__   __. ____    ____      ___           _______..___________..______        ______
//|           ||  | |  \ |  | \   \  /   /     /   \         /       ||           ||   _  \      /  __  \
//`---|  |----`|  | |   \|  |  \   \/   /     /  ^  \       |   (----``---|  |----`|  |_)  |    |  |  |  |
//    |  |     |  | |  . `  |   \_    _/     /  /_\  \       \   \        |  |     |      /     |  |  |  |
//    |  |     |  | |  |\   |     |  |      /  _____  \  .----)   |       |  |     |  |\  \----.|  `--'  |
//    |__|     |__| |__| \__|     |__|     /__/     \__\ |_______/        |__|     | _| `._____| \______/

pragma solidity ^0.8.15;

interface IEmissionRateManager {

  function currentEmissionRate(uint256 tokenRarity) external view returns (uint256 emissionRate);

  function amountToMint(uint256 tokenRarity, uint256 timestamp, uint256 interval) external view returns (uint256 amount, uint256 newTimestamp);
}

File 3 of 11 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 4 of 11 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
        _;
    }

    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate that the this implementation remains valid after an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
        return _IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeTo(address newImplementation) external virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 5 of 11 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
}

File 6 of 11 : ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967UpgradeUpgradeable is Initializable {
    function __ERC1967Upgrade_init() internal onlyInitializing {
    }

    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
    }
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallUUPS(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        // Upgrades from old implementations will perform a rollback test. This test requires the new
        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
        // this special case will break upgrade paths from old UUPS implementation to new ones.
        if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
                require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
            } catch {
                revert("ERC1967Upgrade: new implementation is not UUPS");
            }
            _upgradeToAndCall(newImplementation, data, forceCall);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
        }
    }

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 7 of 11 : draft-IERC1822Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822ProxiableUpgradeable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

File 8 of 11 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 10 of 11 : StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlotUpgradeable {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }
}

File 11 of 11 : IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeaconUpgradeable {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountMinted","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","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":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isFirstPass","type":"bool"},{"indexed":false,"internalType":"uint32","name":"expiration","type":"uint32"}],"name":"Rented","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isFirstStaked","type":"bool"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountMinted","type":"uint256"}],"name":"Unstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"adminUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"astroToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emissionRateManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tinyAstro","type":"address"},{"internalType":"address","name":"_astroToken","type":"address"},{"internalType":"address","name":"_emissionRateManager","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isMintingPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isTokenStaked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"bool","name":"firstPass","type":"bool"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"rent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rentalDurations","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"rentalRecipientStatus","outputs":[{"internalType":"bool","name":"isValid","type":"bool"},{"internalType":"uint32","name":"expiration","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"rentalStatus","outputs":[{"internalType":"uint256[]","name":"stakedTokenIds","type":"uint256[]"},{"internalType":"address[]","name":"recipient1","type":"address[]"},{"internalType":"address[]","name":"recipient2","type":"address[]"},{"internalType":"uint32[]","name":"expiration1","type":"uint32[]"},{"internalType":"uint32[]","name":"expiration2","type":"uint32[]"},{"internalType":"bool[]","name":"isValid1","type":"bool[]"},{"internalType":"bool[]","name":"isValid2","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setEmissionRateManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setMintingPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakedTokens","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint32","name":"timestamp","type":"uint32"},{"internalType":"bool","name":"isFirstStaked","type":"bool"},{"internalType":"address","name":"recipient1","type":"address"},{"internalType":"uint32","name":"expiration1","type":"uint32"},{"internalType":"address","name":"recipient2","type":"address"},{"internalType":"uint32","name":"expiration2","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"stakingStatus","outputs":[{"internalType":"uint256[]","name":"stakedTokenIds","type":"uint256[]"},{"internalType":"uint256","name":"dailyYield","type":"uint256"},{"internalType":"uint256","name":"amountToMint","type":"uint256"},{"internalType":"uint256","name":"amountMinted","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tinyAstro","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenOwners","outputs":[{"internalType":"uint256","name":"amountMinted","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenRarities","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":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"toAdd","type":"uint256[]"},{"internalType":"uint256[]","name":"toRemove","type":"uint256[]"}],"name":"updateRentalDurations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"rarity","type":"uint256"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"updateTokenRarity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]

60a0604052306080523480156200001557600080fd5b50600054610100900460ff1615808015620000375750600054600160ff909116105b8062000067575062000054306200014160201b620021551760201c565b15801562000067575060005460ff166001145b620000cf5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff191660011790558015620000f3576000805461ff0019166101001790555b80156200013a576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5062000150565b6001600160a01b03163b151590565b6080516135406200018860003960008181610ebe01528181610f430152818161161101528181611696015261178001526135406000f3fe6080604052600436106101cd5760003560e01c8063715018a6116100f7578063b187bd2611610095578063dfec876111610064578063dfec87611461062b578063e449f3411461064b578063f0a524241461066b578063f2fde38b146106a357600080fd5b8063b187bd26146104f0578063b487677b14610511578063c07885551461054d578063c0c53b8b1461060b57600080fd5b8063ab5bd4c0116100d1578063ab5bd4c014610460578063ad13419d14610480578063ad79e94b146104a0578063b07b84fb146104d057600080fd5b8063715018a61461040d5780638da5cb5b14610422578063a2728a5b1461044057600080fd5b80632e105b421161016f5780634837eb1f1161013e5780634837eb1f146103a05780634e71d92d146103d05780634f1ef286146103e557806352d1902d146103f857600080fd5b80632e105b421461030757806330c793c41461032857806335abb853146103605780633659cfe61461038057600080fd5b80630fbf0a93116101ab5780630fbf0a9314610274578063133ef8141461029457806316c38b3c146102b457806319323478146102d457600080fd5b8063095e7512146101d257806309687c56146102175780630aea239414610239575b600080fd5b3480156101de57600080fd5b506102026101ed366004612e8d565b60cd6020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b34801561022357600080fd5b50610237610232366004612ef2565b6106c3565b005b34801561024557600080fd5b50610266610254366004612e8d565b60cc6020526000908152604090205481565b60405190815260200161020e565b34801561028057600080fd5b5061023761028f366004612f3e565b610715565b3480156102a057600080fd5b506102376102af366004612f80565b6107a2565b3480156102c057600080fd5b506102376102cf366004613001565b61084f565b3480156102e057600080fd5b506102f46102ef366004613031565b610890565b60405161020e979695949392919061312a565b34801561031357600080fd5b5060cb5461020290600160a81b900460ff1681565b34801561033457600080fd5b5060cb54610348906001600160a01b031681565b6040516001600160a01b03909116815260200161020e565b34801561036c57600080fd5b5061023761037b3660046131c1565b610cb4565b34801561038c57600080fd5b5061023761039b366004613031565b610eb4565b3480156103ac57600080fd5b506103c06103bb366004613031565b61102f565b60405161020e94939291906131fd565b3480156103dc57600080fd5b50610237611244565b6102376103f3366004613242565b611607565b34801561040457600080fd5b50610266611773565b34801561041957600080fd5b50610237611838565b34801561042e57600080fd5b506097546001600160a01b0316610348565b34801561044c57600080fd5b5060c954610348906001600160a01b031681565b34801561046c57600080fd5b5061023761047b366004613031565b61184c565b34801561048c57600080fd5b5061023761049b366004613001565b611876565b3480156104ac57600080fd5b506102666104bb366004613031565b60cf6020526000908152604090206001015481565b3480156104dc57600080fd5b506102376104eb366004613306565b6118b7565b3480156104fc57600080fd5b5060cb5461020290600160a01b900460ff1681565b34801561051d57600080fd5b5061053161052c366004613031565b611b95565b60408051921515835263ffffffff90911660208301520161020e565b34801561055957600080fd5b506105bf610568366004612e8d565b60ce602052600090815260409020805460018201546002909201546001600160a01b0380831693600160a01b80850463ffffffff90811695600160c01b900460ff1694848416949383900482169381169290041687565b604080516001600160a01b03988916815263ffffffff9788166020820152951515908601529286166060850152908416608084015290931660a0820152911660c082015260e00161020e565b34801561061757600080fd5b5061023761062636600461334c565b611c7a565b34801561063757600080fd5b5060ca54610348906001600160a01b031681565b34801561065757600080fd5b50610237610666366004612f3e565b611e8e565b34801561067757600080fd5b50610202610686366004612e8d565b600090815260ce60205260409020546001600160a01b0316151590565b3480156106af57600080fd5b506102376106be366004613031565b6120c8565b6106cb612164565b60005b8181101561070f578360cc60008585858181106106ed576106ed613397565b60209081029290920135835250810191909152604001600020556001016106ce565b50505050565b60cb54600160a01b900460ff16156107695760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b60448201526064015b60405180910390fd5b60005b8181101561079d5761079583838381811061078957610789613397565b905060200201356121be565b60010161076c565b505050565b6107aa612164565b60005b838110156107fd57600160cd60008787858181106107cd576107cd613397565b60209081029290920135835250810191909152604001600020805460ff19169115159190911790556001016107ad565b5060005b818110156108485760cd600084848481811061081f5761081f613397565b60209081029290920135835250810191909152604001600020805460ff19169055600101610801565b5050505050565b610857612164565b60cb8054911515600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b606080606080606080606060cf6000896001600160a01b03166001600160a01b0316815260200190815260200160002060000180548060200260200160405190810160405280929190818152602001828054801561090d57602002820191906000526020600020905b8154815260200190600101908083116108f9575b50508351939a50839250505067ffffffffffffffff8111156109315761093161322c565b60405190808252806020026020018201604052801561095a578160200160208202803683370190505b5096508067ffffffffffffffff8111156109765761097661322c565b60405190808252806020026020018201604052801561099f578160200160208202803683370190505b5095508067ffffffffffffffff8111156109bb576109bb61322c565b6040519080825280602002602001820160405280156109e4578160200160208202803683370190505b5094508067ffffffffffffffff811115610a0057610a0061322c565b604051908082528060200260200182016040528015610a29578160200160208202803683370190505b5093508067ffffffffffffffff811115610a4557610a4561322c565b604051908082528060200260200182016040528015610a6e578160200160208202803683370190505b5092508067ffffffffffffffff811115610a8a57610a8a61322c565b604051908082528060200260200182016040528015610ab3578160200160208202803683370190505b50915060005b8851811015610ca757600060ce60008b8481518110610ada57610ada613397565b6020908102919091018101518252818101929092526040908101600020815160e08101835281546001600160a01b038082168352600160a01b80830463ffffffff90811697850197909752600160c01b90920460ff16151594830194909452600183015480851660608401819052908290048616608084015260029093015493841660a083015290920490921660c08201528a519092508a9084908110610b8357610b83613397565b60200260200101906001600160a01b031690816001600160a01b0316815250508060a00151888381518110610bba57610bba613397565b60200260200101906001600160a01b031690816001600160a01b0316815250508060800151878381518110610bf157610bf1613397565b602002602001019063ffffffff16908163ffffffff16815250508060c00151868381518110610c2257610c22613397565b602002602001019063ffffffff16908163ffffffff168152505042816080015163ffffffff161015858381518110610c5c57610c5c613397565b602002602001019015159081151581525050428160c0015163ffffffff161015848381518110610c8e57610c8e613397565b9115156020928302919091019091015250600101610ab9565b5050919395979092949650565b610cbc612164565b80610cfb5760405162461bcd60e51b815260206004820152600f60248201526e456d70747920746f6b656e2069647360881b6044820152606401610760565b6001600160a01b038316600090815260cf602052604090208054610d545760405162461bcd60e51b815260206004820152601060248201526f4e6f207374616b656420746f6b656e7360801b6044820152606401610760565b805482106000805b84811015610d9357610d87868683818110610d7957610d79613397565b9050602002013560006123b4565b90910190600101610d5c565b508115610e355760ce600084600001600081548110610db457610db4613397565b9060005260206000200154815260200190815260200160002060000160189054906101000a900460ff16610e355760405162461bcd60e51b815260206004820152602260248201527f466972737420746f6b656e2063616e6e6f7420626520756e7374616b65642079604482015261195d60f21b6064820152608401610760565b8015610eac5760ca546040516340c10f1960e01b81526001600160a01b03888116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b158015610e8957600080fd5b505af1158015610e9d573d6000803e3d6000fd5b50505060018401805483019055505b505050505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610f415760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608401610760565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610f9c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146110075760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608401610760565b61101081612653565b6040805160008082526020820190925261102c9183919061265b565b50565b6001600160a01b038116600090815260cf602090815260408083208151815493840281016060908101845292810184815292949384938493849392909183918390838b01828280156110a057602002820191906000526020600020905b81548152602001906001019080831161108c575b50505091835250506001919091015460209182015281519082015160cb549197509350909150600160a81b900460ff1661123c5760005b855181101561123a5760008682815181106110f4576110f4613397565b60209081029190910181015160cb54600082815260cc90935260409283902054925163206e141560e21b815260048101939093529092506001600160a01b0316906381b8505490602401602060405180830381865afa15801561115b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117f91906133ad565b60cb54600083815260cc602090815260408083205460ce90925280832054815163708496f760e11b81526004810193909352600160a01b900463ffffffff16602483015262015180604483015280519a9094019991936001600160a01b039093169263e1092dee926064808401938290030181865afa158015611206573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122a91906133c6565b50959095019450506001016110d7565b505b509193509193565b60cb54600160a01b900460ff16156112935760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b6044820152606401610760565b60cb54600160a81b900460ff16156112ed5760405162461bcd60e51b815260206004820152601160248201527f4d696e74696e67206973207061757365640000000000000000000000000000006044820152606401610760565b33600090815260cf602090815260408083208054825181850281018501909352808352919290919083018282801561134457602002820191906000526020600020905b815481526020019060010190808311611330575b50505050509050600081511161138f5760405162461bcd60e51b815260206004820152601060248201526f4e6f207374616b656420746f6b656e7360801b6044820152606401610760565b6000805b82518110156114fa5760008382815181106113b0576113b0613397565b602090810291909101810151600081815260ce90925260409091208054919250906001600160a01b0316331461141e5760405162461bcd60e51b81526020600482015260136024820152722737ba103a3432903a37b5b2b71037bbb732b960691b6044820152606401610760565b60cb54600083815260cc6020526040808220548454825163708496f760e11b81526004810192909252600160a01b900463ffffffff1660248201526201518060448201528151929384936001600160a01b039091169263e1092dee92606480820193918290030181865afa15801561149a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114be91906133c6565b909250905081156114ea57825463ffffffff60a01b1916600160a01b63ffffffff831602178355948101945b5050600190920191506113939050565b506000811161154b5760405162461bcd60e51b815260206004820152601060248201527f5a65726f206d696e7420616d6f756e74000000000000000000000000000000006044820152606401610760565b60ca546040516340c10f1960e01b8152336004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561159757600080fd5b505af11580156115ab573d6000803e3d6000fd5b505033600081815260cf602052604090819020600101805486019055519092507fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a91506115fb9084815260200190565b60405180910390a25050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036116945760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608401610760565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166116ef7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b03161461175a5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608401610760565b61176382612653565b61176f8282600161265b565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118135760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610760565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b611840612164565b61184a60006127fb565b565b611854612164565b60cb80546001600160a01b0319166001600160a01b0392909216919091179055565b61187e612164565b60cb8054911515600160a81b027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909216919091179055565b60cb54600160a01b900460ff16156119065760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b6044820152606401610760565b600081815260cd602052604090205460ff166119645760405162461bcd60e51b815260206004820152601060248201527f496e76616c6964206475726174696f6e000000000000000000000000000000006044820152606401610760565b600084815260ce6020526040902080546001600160a01b031633146119c15760405162461bcd60e51b81526020600482015260136024820152722737ba103a3432903a37b5b2b71037bbb732b960691b6044820152606401610760565b6119ca8461284d565b60006119d96201518084613400565b6119e39042613417565b90508315611a7e57600182015442600160a01b90910463ffffffff1610611a4c5760405162461bcd60e51b815260206004820152601c60248201527f506173732069732072656e7420746f20736f6d656f6e6520656c7365000000006044820152606401610760565b60018201805463ffffffff8316600160a01b026001600160c01b03199091166001600160a01b03881617179055611b22565b8154600160c01b900460ff16158015611aa85750600282015442600160a01b90910463ffffffff16105b611af45760405162461bcd60e51b815260206004820152601c60248201527f506173732069732072656e7420746f20736f6d656f6e6520656c7365000000006044820152606401610760565b60028201805463ffffffff8316600160a01b026001600160c01b03199091166001600160a01b038816171790555b6001600160a01b038516600081815260d06020526040908190208890555187919033907fa5676c14efe4e3c9094761b588d01535d12630a4ed273ef359ec77bb86d14ffd90611b859089908790911515825263ffffffff16602082015260400190565b60405180910390a4505050505050565b6001600160a01b03808216600081815260d0602090815260408083205480845260ce8352818420825160e0810184528154808916825263ffffffff600160a01b80830482169784019790975260ff600160c01b90920491909116151594820194909452600182015480891660608301819052908690048516608083015260029092015497881660a08201529390960490911660c0830152919384939003611c425780608001519250611c67565b846001600160a01b03168160a001516001600160a01b031603611c67578060c0015192505b428363ffffffff16101593505050915091565b600054610100900460ff1615808015611c9a5750600054600160ff909116105b80611cb45750303b158015611cb4575060005460ff166001145b611d265760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610760565b6000805460ff191660011790558015611d49576000805461ff0019166101001790555b60c980546001600160a01b038087166001600160a01b03199283161790925560ca8054868416921691909117905560cb80547fffffffffffffffffffffff0000000000000000000000000000000000000000001691841691909117600160a01b17905560cd6020527f64c45f359ea2f8a06c7d9522781502fc36217a93bbdf992266ddda137e19fb19805460ff1990811660019081179092557f18fde8c8b5097bf187010b47e7676c073bbd43a68dbeb6c0edcc5f216d4dab608054821683179055601e6000527fce97ddc9b67280624741106601de485969d68ac99197ceea489c92427679905180549091169091179055611e43612a55565b801561070f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b60cb54600160a01b900460ff1615611edd5760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b6044820152606401610760565b80611f1c5760405162461bcd60e51b815260206004820152600f60248201526e456d70747920746f6b656e2069647360881b6044820152606401610760565b33600090815260cf602052604090208054611f6c5760405162461bcd60e51b815260206004820152601060248201526f4e6f207374616b656420746f6b656e7360801b6044820152606401610760565b805482106000805b84811015611fab57611f9f868683818110611f9157611f91613397565b9050602002013560016123b4565b90910190600101611f74565b50811561204d5760ce600084600001600081548110611fcc57611fcc613397565b9060005260206000200154815260200190815260200160002060000160189054906101000a900460ff1661204d5760405162461bcd60e51b815260206004820152602260248201527f466972737420746f6b656e2063616e6e6f7420626520756e7374616b65642079604482015261195d60f21b6064820152608401610760565b80156108485760ca546040516340c10f1960e01b8152336004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561209f57600080fd5b505af11580156120b3573d6000803e3d6000fd5b50505060018401805483019055505050505050565b6120d0612164565b6001600160a01b03811661214c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610760565b61102c816127fb565b6001600160a01b03163b151590565b6097546001600160a01b0316331461184a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610760565b60c9546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa158015612207573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061222b919061342a565b6001600160a01b0316146122775760405162461bcd60e51b81526020600482015260136024820152722737ba103a3432903a37b5b2b71037bbb732b960691b6044820152606401610760565b600081815260ce6020526040902080546001600160a01b0316156122dd5760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20697320616c7265616479207374616b65640000000000000000006044820152606401610760565b805463ffffffff4216600160a01b0263ffffffff60a01b19339081166001600160c01b03199093169290921717808355600082815260cf602090815260408083208054600160c01b901581027fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff909616959095178755805460018101825581855292909320909101869055845490519193869390927f37d4053e34fde482e96f6bcd424dfa31342cbd5fe184d497fb3c8bb4b4b97580926123a792900460ff161515815260200190565b60405180910390a3505050565b600082815260ce60209081526040808320815160e08101835281546001600160a01b038082168352600160a01b80830463ffffffff90811697850197909752600160c01b90920460ff16151594830194909452600183015480851660608401528190048516608083015260029092015492831660a0820152910490911660c082015282156124f95780516001600160a01b0316331461248b5760405162461bcd60e51b81526020600482015260136024820152722737ba103a3432903a37b5b2b71037bbb732b960691b6044820152606401610760565b42816080015163ffffffff161080156124ad5750428160c0015163ffffffff16105b6124f95760405162461bcd60e51b815260206004820152601f60248201527f556e7374616b652077697468206163746976652072656e74616c2070617373006044820152606401610760565b60cb54600160a81b900460ff166125aa5760cb54600085815260cc60209081526040918290205490840151825163708496f760e11b8152600481019290925263ffffffff16602482015262015180604482015281516001600160a01b039093169263e1092dee926064808401939192918290030181865afa158015612582573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a691906133c6565b5091505b600084815260ce6020526040902080547fffffffffffffff000000000000000000000000000000000000000000000000001681556001810180546001600160c01b0319908116909155600290910180549091169055805161260b9085612ac8565b805160405183815285916001600160a01b0316907f7fc4727e062e336010f2c282598ef5f14facb3de68cf8195c2f23e1454b2b74e9060200160405180910390a35092915050565b61102c612164565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561268e5761079d83612b20565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156126e8575060408051601f3d908101601f191682019092526126e5918101906133ad565b60015b61275a5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608401610760565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146127ef5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608401610760565b5061079d838383612bde565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60c9546040516370a0823160e01b81526001600160a01b038381166004830152909116906370a0823190602401602060405180830381865afa158015612897573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128bb91906133ad565b156129085760405162461bcd60e51b815260206004820152601860248201527f526563697069656e742069732061204e4654206f776e657200000000000000006044820152606401610760565b6001600160a01b03808216600081815260d06020908152604080832054835260ce8252808320815160e0810183528154808816825263ffffffff600160a01b80830482169684019690965260ff600160c01b90920491909116151593820193909352600182015480881660608301819052908590048416608083015260029092015496871660a0820152929095041660c082015292909190036129b65750608081015163ffffffff166129e0565b826001600160a01b03168260a001516001600160a01b0316036129e0575060c081015163ffffffff165b42811061079d5760405162461bcd60e51b815260206004820152603360248201527f526563697069656e7420697320696e20706f7373657373696f6e206f6620616e60448201527f206163746976652072656e74616c2070617373000000000000000000000000006064820152608401610760565b600054610100900460ff16612ac05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610760565b61184a612c03565b6001600160a01b038216600090815260cf60205260408120905b815481101561070f5782828281548110612afe57612afe613397565b906000526020600020015403612b185761070f8282612c77565b600101612ae2565b6001600160a01b0381163b612b9d5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401610760565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b612be783612d00565b600082511180612bf45750805b1561079d5761070f8383612d40565b600054610100900460ff16612c6e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610760565b61184a336127fb565b8154612c8590600190613447565b811015612cd65781548290612c9c90600190613447565b81548110612cac57612cac613397565b9060005260206000200154828281548110612cc957612cc9613397565b6000918252602090912001555b81805480612ce657612ce661345a565b600190038181906000526020600020016000905590555050565b612d0981612b20565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b612dbf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610760565b600080846001600160a01b031684604051612dda9190613494565b600060405180830381855af49150503d8060008114612e15576040519150601f19603f3d011682016040523d82523d6000602084013e612e1a565b606091505b5091509150612e4282826040518060600160405280602781526020016134e460279139612e4d565b925050505b92915050565b60608315612e5c575081612e86565b825115612e6c5782518084602001fd5b8160405162461bcd60e51b815260040161076091906134b0565b9392505050565b600060208284031215612e9f57600080fd5b5035919050565b60008083601f840112612eb857600080fd5b50813567ffffffffffffffff811115612ed057600080fd5b6020830191508360208260051b8501011115612eeb57600080fd5b9250929050565b600080600060408486031215612f0757600080fd5b83359250602084013567ffffffffffffffff811115612f2557600080fd5b612f3186828701612ea6565b9497909650939450505050565b60008060208385031215612f5157600080fd5b823567ffffffffffffffff811115612f6857600080fd5b612f7485828601612ea6565b90969095509350505050565b60008060008060408587031215612f9657600080fd5b843567ffffffffffffffff80821115612fae57600080fd5b612fba88838901612ea6565b90965094506020870135915080821115612fd357600080fd5b50612fe087828801612ea6565b95989497509550505050565b80358015158114612ffc57600080fd5b919050565b60006020828403121561301357600080fd5b612e8682612fec565b6001600160a01b038116811461102c57600080fd5b60006020828403121561304357600080fd5b8135612e868161301c565b600081518084526020808501945080840160005b8381101561307e57815187529582019590820190600101613062565b509495945050505050565b600081518084526020808501945080840160005b8381101561307e5781516001600160a01b03168752958201959082019060010161309d565b600081518084526020808501945080840160005b8381101561307e57815163ffffffff16875295820195908201906001016130d6565b600081518084526020808501945080840160005b8381101561307e57815115158752958201959082019060010161310c565b60e08152600061313d60e083018a61304e565b828103602084015261314f818a613089565b905082810360408401526131638189613089565b9050828103606084015261317781886130c2565b9050828103608084015261318b81876130c2565b905082810360a084015261319f81866130f8565b905082810360c08401526131b381856130f8565b9a9950505050505050505050565b6000806000604084860312156131d657600080fd5b83356131e18161301c565b9250602084013567ffffffffffffffff811115612f2557600080fd5b608081526000613210608083018761304e565b6020830195909552506040810192909252606090910152919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561325557600080fd5b82356132608161301c565b9150602083013567ffffffffffffffff8082111561327d57600080fd5b818501915085601f83011261329157600080fd5b8135818111156132a3576132a361322c565b604051601f8201601f19908116603f011681019083821181831017156132cb576132cb61322c565b816040528281528860208487010111156132e457600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000806000806080858703121561331c57600080fd5b84359350602085013561332e8161301c565b925061333c60408601612fec565b9396929550929360600135925050565b60008060006060848603121561336157600080fd5b833561336c8161301c565b9250602084013561337c8161301c565b9150604084013561338c8161301c565b809150509250925092565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156133bf57600080fd5b5051919050565b600080604083850312156133d957600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417612e4757612e476133ea565b80820180821115612e4757612e476133ea565b60006020828403121561343c57600080fd5b8151612e868161301c565b81810381811115612e4757612e476133ea565b634e487b7160e01b600052603160045260246000fd5b60005b8381101561348b578181015183820152602001613473565b50506000910152565b600082516134a6818460208701613470565b9190910192915050565b60208152600082518060208401526134cf816040850160208701613470565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122064391ba99dc75f18345edd07ea3b78d539125b188e8a5afcec0ef638830970ee64736f6c63430008110033

Deployed Bytecode

0x6080604052600436106101cd5760003560e01c8063715018a6116100f7578063b187bd2611610095578063dfec876111610064578063dfec87611461062b578063e449f3411461064b578063f0a524241461066b578063f2fde38b146106a357600080fd5b8063b187bd26146104f0578063b487677b14610511578063c07885551461054d578063c0c53b8b1461060b57600080fd5b8063ab5bd4c0116100d1578063ab5bd4c014610460578063ad13419d14610480578063ad79e94b146104a0578063b07b84fb146104d057600080fd5b8063715018a61461040d5780638da5cb5b14610422578063a2728a5b1461044057600080fd5b80632e105b421161016f5780634837eb1f1161013e5780634837eb1f146103a05780634e71d92d146103d05780634f1ef286146103e557806352d1902d146103f857600080fd5b80632e105b421461030757806330c793c41461032857806335abb853146103605780633659cfe61461038057600080fd5b80630fbf0a93116101ab5780630fbf0a9314610274578063133ef8141461029457806316c38b3c146102b457806319323478146102d457600080fd5b8063095e7512146101d257806309687c56146102175780630aea239414610239575b600080fd5b3480156101de57600080fd5b506102026101ed366004612e8d565b60cd6020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b34801561022357600080fd5b50610237610232366004612ef2565b6106c3565b005b34801561024557600080fd5b50610266610254366004612e8d565b60cc6020526000908152604090205481565b60405190815260200161020e565b34801561028057600080fd5b5061023761028f366004612f3e565b610715565b3480156102a057600080fd5b506102376102af366004612f80565b6107a2565b3480156102c057600080fd5b506102376102cf366004613001565b61084f565b3480156102e057600080fd5b506102f46102ef366004613031565b610890565b60405161020e979695949392919061312a565b34801561031357600080fd5b5060cb5461020290600160a81b900460ff1681565b34801561033457600080fd5b5060cb54610348906001600160a01b031681565b6040516001600160a01b03909116815260200161020e565b34801561036c57600080fd5b5061023761037b3660046131c1565b610cb4565b34801561038c57600080fd5b5061023761039b366004613031565b610eb4565b3480156103ac57600080fd5b506103c06103bb366004613031565b61102f565b60405161020e94939291906131fd565b3480156103dc57600080fd5b50610237611244565b6102376103f3366004613242565b611607565b34801561040457600080fd5b50610266611773565b34801561041957600080fd5b50610237611838565b34801561042e57600080fd5b506097546001600160a01b0316610348565b34801561044c57600080fd5b5060c954610348906001600160a01b031681565b34801561046c57600080fd5b5061023761047b366004613031565b61184c565b34801561048c57600080fd5b5061023761049b366004613001565b611876565b3480156104ac57600080fd5b506102666104bb366004613031565b60cf6020526000908152604090206001015481565b3480156104dc57600080fd5b506102376104eb366004613306565b6118b7565b3480156104fc57600080fd5b5060cb5461020290600160a01b900460ff1681565b34801561051d57600080fd5b5061053161052c366004613031565b611b95565b60408051921515835263ffffffff90911660208301520161020e565b34801561055957600080fd5b506105bf610568366004612e8d565b60ce602052600090815260409020805460018201546002909201546001600160a01b0380831693600160a01b80850463ffffffff90811695600160c01b900460ff1694848416949383900482169381169290041687565b604080516001600160a01b03988916815263ffffffff9788166020820152951515908601529286166060850152908416608084015290931660a0820152911660c082015260e00161020e565b34801561061757600080fd5b5061023761062636600461334c565b611c7a565b34801561063757600080fd5b5060ca54610348906001600160a01b031681565b34801561065757600080fd5b50610237610666366004612f3e565b611e8e565b34801561067757600080fd5b50610202610686366004612e8d565b600090815260ce60205260409020546001600160a01b0316151590565b3480156106af57600080fd5b506102376106be366004613031565b6120c8565b6106cb612164565b60005b8181101561070f578360cc60008585858181106106ed576106ed613397565b60209081029290920135835250810191909152604001600020556001016106ce565b50505050565b60cb54600160a01b900460ff16156107695760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b60448201526064015b60405180910390fd5b60005b8181101561079d5761079583838381811061078957610789613397565b905060200201356121be565b60010161076c565b505050565b6107aa612164565b60005b838110156107fd57600160cd60008787858181106107cd576107cd613397565b60209081029290920135835250810191909152604001600020805460ff19169115159190911790556001016107ad565b5060005b818110156108485760cd600084848481811061081f5761081f613397565b60209081029290920135835250810191909152604001600020805460ff19169055600101610801565b5050505050565b610857612164565b60cb8054911515600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b606080606080606080606060cf6000896001600160a01b03166001600160a01b0316815260200190815260200160002060000180548060200260200160405190810160405280929190818152602001828054801561090d57602002820191906000526020600020905b8154815260200190600101908083116108f9575b50508351939a50839250505067ffffffffffffffff8111156109315761093161322c565b60405190808252806020026020018201604052801561095a578160200160208202803683370190505b5096508067ffffffffffffffff8111156109765761097661322c565b60405190808252806020026020018201604052801561099f578160200160208202803683370190505b5095508067ffffffffffffffff8111156109bb576109bb61322c565b6040519080825280602002602001820160405280156109e4578160200160208202803683370190505b5094508067ffffffffffffffff811115610a0057610a0061322c565b604051908082528060200260200182016040528015610a29578160200160208202803683370190505b5093508067ffffffffffffffff811115610a4557610a4561322c565b604051908082528060200260200182016040528015610a6e578160200160208202803683370190505b5092508067ffffffffffffffff811115610a8a57610a8a61322c565b604051908082528060200260200182016040528015610ab3578160200160208202803683370190505b50915060005b8851811015610ca757600060ce60008b8481518110610ada57610ada613397565b6020908102919091018101518252818101929092526040908101600020815160e08101835281546001600160a01b038082168352600160a01b80830463ffffffff90811697850197909752600160c01b90920460ff16151594830194909452600183015480851660608401819052908290048616608084015260029093015493841660a083015290920490921660c08201528a519092508a9084908110610b8357610b83613397565b60200260200101906001600160a01b031690816001600160a01b0316815250508060a00151888381518110610bba57610bba613397565b60200260200101906001600160a01b031690816001600160a01b0316815250508060800151878381518110610bf157610bf1613397565b602002602001019063ffffffff16908163ffffffff16815250508060c00151868381518110610c2257610c22613397565b602002602001019063ffffffff16908163ffffffff168152505042816080015163ffffffff161015858381518110610c5c57610c5c613397565b602002602001019015159081151581525050428160c0015163ffffffff161015848381518110610c8e57610c8e613397565b9115156020928302919091019091015250600101610ab9565b5050919395979092949650565b610cbc612164565b80610cfb5760405162461bcd60e51b815260206004820152600f60248201526e456d70747920746f6b656e2069647360881b6044820152606401610760565b6001600160a01b038316600090815260cf602052604090208054610d545760405162461bcd60e51b815260206004820152601060248201526f4e6f207374616b656420746f6b656e7360801b6044820152606401610760565b805482106000805b84811015610d9357610d87868683818110610d7957610d79613397565b9050602002013560006123b4565b90910190600101610d5c565b508115610e355760ce600084600001600081548110610db457610db4613397565b9060005260206000200154815260200190815260200160002060000160189054906101000a900460ff16610e355760405162461bcd60e51b815260206004820152602260248201527f466972737420746f6b656e2063616e6e6f7420626520756e7374616b65642079604482015261195d60f21b6064820152608401610760565b8015610eac5760ca546040516340c10f1960e01b81526001600160a01b03888116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b158015610e8957600080fd5b505af1158015610e9d573d6000803e3d6000fd5b50505060018401805483019055505b505050505050565b6001600160a01b037f0000000000000000000000001be7ac1d4974c9920e30e2dbc3a57f9e0e1c8ef2163003610f415760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608401610760565b7f0000000000000000000000001be7ac1d4974c9920e30e2dbc3a57f9e0e1c8ef26001600160a01b0316610f9c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146110075760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608401610760565b61101081612653565b6040805160008082526020820190925261102c9183919061265b565b50565b6001600160a01b038116600090815260cf602090815260408083208151815493840281016060908101845292810184815292949384938493849392909183918390838b01828280156110a057602002820191906000526020600020905b81548152602001906001019080831161108c575b50505091835250506001919091015460209182015281519082015160cb549197509350909150600160a81b900460ff1661123c5760005b855181101561123a5760008682815181106110f4576110f4613397565b60209081029190910181015160cb54600082815260cc90935260409283902054925163206e141560e21b815260048101939093529092506001600160a01b0316906381b8505490602401602060405180830381865afa15801561115b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117f91906133ad565b60cb54600083815260cc602090815260408083205460ce90925280832054815163708496f760e11b81526004810193909352600160a01b900463ffffffff16602483015262015180604483015280519a9094019991936001600160a01b039093169263e1092dee926064808401938290030181865afa158015611206573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122a91906133c6565b50959095019450506001016110d7565b505b509193509193565b60cb54600160a01b900460ff16156112935760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b6044820152606401610760565b60cb54600160a81b900460ff16156112ed5760405162461bcd60e51b815260206004820152601160248201527f4d696e74696e67206973207061757365640000000000000000000000000000006044820152606401610760565b33600090815260cf602090815260408083208054825181850281018501909352808352919290919083018282801561134457602002820191906000526020600020905b815481526020019060010190808311611330575b50505050509050600081511161138f5760405162461bcd60e51b815260206004820152601060248201526f4e6f207374616b656420746f6b656e7360801b6044820152606401610760565b6000805b82518110156114fa5760008382815181106113b0576113b0613397565b602090810291909101810151600081815260ce90925260409091208054919250906001600160a01b0316331461141e5760405162461bcd60e51b81526020600482015260136024820152722737ba103a3432903a37b5b2b71037bbb732b960691b6044820152606401610760565b60cb54600083815260cc6020526040808220548454825163708496f760e11b81526004810192909252600160a01b900463ffffffff1660248201526201518060448201528151929384936001600160a01b039091169263e1092dee92606480820193918290030181865afa15801561149a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114be91906133c6565b909250905081156114ea57825463ffffffff60a01b1916600160a01b63ffffffff831602178355948101945b5050600190920191506113939050565b506000811161154b5760405162461bcd60e51b815260206004820152601060248201527f5a65726f206d696e7420616d6f756e74000000000000000000000000000000006044820152606401610760565b60ca546040516340c10f1960e01b8152336004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561159757600080fd5b505af11580156115ab573d6000803e3d6000fd5b505033600081815260cf602052604090819020600101805486019055519092507fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a91506115fb9084815260200190565b60405180910390a25050565b6001600160a01b037f0000000000000000000000001be7ac1d4974c9920e30e2dbc3a57f9e0e1c8ef21630036116945760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608401610760565b7f0000000000000000000000001be7ac1d4974c9920e30e2dbc3a57f9e0e1c8ef26001600160a01b03166116ef7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b03161461175a5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608401610760565b61176382612653565b61176f8282600161265b565b5050565b6000306001600160a01b037f0000000000000000000000001be7ac1d4974c9920e30e2dbc3a57f9e0e1c8ef216146118135760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610760565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b611840612164565b61184a60006127fb565b565b611854612164565b60cb80546001600160a01b0319166001600160a01b0392909216919091179055565b61187e612164565b60cb8054911515600160a81b027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909216919091179055565b60cb54600160a01b900460ff16156119065760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b6044820152606401610760565b600081815260cd602052604090205460ff166119645760405162461bcd60e51b815260206004820152601060248201527f496e76616c6964206475726174696f6e000000000000000000000000000000006044820152606401610760565b600084815260ce6020526040902080546001600160a01b031633146119c15760405162461bcd60e51b81526020600482015260136024820152722737ba103a3432903a37b5b2b71037bbb732b960691b6044820152606401610760565b6119ca8461284d565b60006119d96201518084613400565b6119e39042613417565b90508315611a7e57600182015442600160a01b90910463ffffffff1610611a4c5760405162461bcd60e51b815260206004820152601c60248201527f506173732069732072656e7420746f20736f6d656f6e6520656c7365000000006044820152606401610760565b60018201805463ffffffff8316600160a01b026001600160c01b03199091166001600160a01b03881617179055611b22565b8154600160c01b900460ff16158015611aa85750600282015442600160a01b90910463ffffffff16105b611af45760405162461bcd60e51b815260206004820152601c60248201527f506173732069732072656e7420746f20736f6d656f6e6520656c7365000000006044820152606401610760565b60028201805463ffffffff8316600160a01b026001600160c01b03199091166001600160a01b038816171790555b6001600160a01b038516600081815260d06020526040908190208890555187919033907fa5676c14efe4e3c9094761b588d01535d12630a4ed273ef359ec77bb86d14ffd90611b859089908790911515825263ffffffff16602082015260400190565b60405180910390a4505050505050565b6001600160a01b03808216600081815260d0602090815260408083205480845260ce8352818420825160e0810184528154808916825263ffffffff600160a01b80830482169784019790975260ff600160c01b90920491909116151594820194909452600182015480891660608301819052908690048516608083015260029092015497881660a08201529390960490911660c0830152919384939003611c425780608001519250611c67565b846001600160a01b03168160a001516001600160a01b031603611c67578060c0015192505b428363ffffffff16101593505050915091565b600054610100900460ff1615808015611c9a5750600054600160ff909116105b80611cb45750303b158015611cb4575060005460ff166001145b611d265760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610760565b6000805460ff191660011790558015611d49576000805461ff0019166101001790555b60c980546001600160a01b038087166001600160a01b03199283161790925560ca8054868416921691909117905560cb80547fffffffffffffffffffffff0000000000000000000000000000000000000000001691841691909117600160a01b17905560cd6020527f64c45f359ea2f8a06c7d9522781502fc36217a93bbdf992266ddda137e19fb19805460ff1990811660019081179092557f18fde8c8b5097bf187010b47e7676c073bbd43a68dbeb6c0edcc5f216d4dab608054821683179055601e6000527fce97ddc9b67280624741106601de485969d68ac99197ceea489c92427679905180549091169091179055611e43612a55565b801561070f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b60cb54600160a01b900460ff1615611edd5760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b6044820152606401610760565b80611f1c5760405162461bcd60e51b815260206004820152600f60248201526e456d70747920746f6b656e2069647360881b6044820152606401610760565b33600090815260cf602052604090208054611f6c5760405162461bcd60e51b815260206004820152601060248201526f4e6f207374616b656420746f6b656e7360801b6044820152606401610760565b805482106000805b84811015611fab57611f9f868683818110611f9157611f91613397565b9050602002013560016123b4565b90910190600101611f74565b50811561204d5760ce600084600001600081548110611fcc57611fcc613397565b9060005260206000200154815260200190815260200160002060000160189054906101000a900460ff1661204d5760405162461bcd60e51b815260206004820152602260248201527f466972737420746f6b656e2063616e6e6f7420626520756e7374616b65642079604482015261195d60f21b6064820152608401610760565b80156108485760ca546040516340c10f1960e01b8152336004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561209f57600080fd5b505af11580156120b3573d6000803e3d6000fd5b50505060018401805483019055505050505050565b6120d0612164565b6001600160a01b03811661214c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610760565b61102c816127fb565b6001600160a01b03163b151590565b6097546001600160a01b0316331461184a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610760565b60c9546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa158015612207573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061222b919061342a565b6001600160a01b0316146122775760405162461bcd60e51b81526020600482015260136024820152722737ba103a3432903a37b5b2b71037bbb732b960691b6044820152606401610760565b600081815260ce6020526040902080546001600160a01b0316156122dd5760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20697320616c7265616479207374616b65640000000000000000006044820152606401610760565b805463ffffffff4216600160a01b0263ffffffff60a01b19339081166001600160c01b03199093169290921717808355600082815260cf602090815260408083208054600160c01b901581027fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff909616959095178755805460018101825581855292909320909101869055845490519193869390927f37d4053e34fde482e96f6bcd424dfa31342cbd5fe184d497fb3c8bb4b4b97580926123a792900460ff161515815260200190565b60405180910390a3505050565b600082815260ce60209081526040808320815160e08101835281546001600160a01b038082168352600160a01b80830463ffffffff90811697850197909752600160c01b90920460ff16151594830194909452600183015480851660608401528190048516608083015260029092015492831660a0820152910490911660c082015282156124f95780516001600160a01b0316331461248b5760405162461bcd60e51b81526020600482015260136024820152722737ba103a3432903a37b5b2b71037bbb732b960691b6044820152606401610760565b42816080015163ffffffff161080156124ad5750428160c0015163ffffffff16105b6124f95760405162461bcd60e51b815260206004820152601f60248201527f556e7374616b652077697468206163746976652072656e74616c2070617373006044820152606401610760565b60cb54600160a81b900460ff166125aa5760cb54600085815260cc60209081526040918290205490840151825163708496f760e11b8152600481019290925263ffffffff16602482015262015180604482015281516001600160a01b039093169263e1092dee926064808401939192918290030181865afa158015612582573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a691906133c6565b5091505b600084815260ce6020526040902080547fffffffffffffff000000000000000000000000000000000000000000000000001681556001810180546001600160c01b0319908116909155600290910180549091169055805161260b9085612ac8565b805160405183815285916001600160a01b0316907f7fc4727e062e336010f2c282598ef5f14facb3de68cf8195c2f23e1454b2b74e9060200160405180910390a35092915050565b61102c612164565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561268e5761079d83612b20565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156126e8575060408051601f3d908101601f191682019092526126e5918101906133ad565b60015b61275a5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608401610760565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146127ef5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608401610760565b5061079d838383612bde565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60c9546040516370a0823160e01b81526001600160a01b038381166004830152909116906370a0823190602401602060405180830381865afa158015612897573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128bb91906133ad565b156129085760405162461bcd60e51b815260206004820152601860248201527f526563697069656e742069732061204e4654206f776e657200000000000000006044820152606401610760565b6001600160a01b03808216600081815260d06020908152604080832054835260ce8252808320815160e0810183528154808816825263ffffffff600160a01b80830482169684019690965260ff600160c01b90920491909116151593820193909352600182015480881660608301819052908590048416608083015260029092015496871660a0820152929095041660c082015292909190036129b65750608081015163ffffffff166129e0565b826001600160a01b03168260a001516001600160a01b0316036129e0575060c081015163ffffffff165b42811061079d5760405162461bcd60e51b815260206004820152603360248201527f526563697069656e7420697320696e20706f7373657373696f6e206f6620616e60448201527f206163746976652072656e74616c2070617373000000000000000000000000006064820152608401610760565b600054610100900460ff16612ac05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610760565b61184a612c03565b6001600160a01b038216600090815260cf60205260408120905b815481101561070f5782828281548110612afe57612afe613397565b906000526020600020015403612b185761070f8282612c77565b600101612ae2565b6001600160a01b0381163b612b9d5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401610760565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b612be783612d00565b600082511180612bf45750805b1561079d5761070f8383612d40565b600054610100900460ff16612c6e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610760565b61184a336127fb565b8154612c8590600190613447565b811015612cd65781548290612c9c90600190613447565b81548110612cac57612cac613397565b9060005260206000200154828281548110612cc957612cc9613397565b6000918252602090912001555b81805480612ce657612ce661345a565b600190038181906000526020600020016000905590555050565b612d0981612b20565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b612dbf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610760565b600080846001600160a01b031684604051612dda9190613494565b600060405180830381855af49150503d8060008114612e15576040519150601f19603f3d011682016040523d82523d6000602084013e612e1a565b606091505b5091509150612e4282826040518060600160405280602781526020016134e460279139612e4d565b925050505b92915050565b60608315612e5c575081612e86565b825115612e6c5782518084602001fd5b8160405162461bcd60e51b815260040161076091906134b0565b9392505050565b600060208284031215612e9f57600080fd5b5035919050565b60008083601f840112612eb857600080fd5b50813567ffffffffffffffff811115612ed057600080fd5b6020830191508360208260051b8501011115612eeb57600080fd5b9250929050565b600080600060408486031215612f0757600080fd5b83359250602084013567ffffffffffffffff811115612f2557600080fd5b612f3186828701612ea6565b9497909650939450505050565b60008060208385031215612f5157600080fd5b823567ffffffffffffffff811115612f6857600080fd5b612f7485828601612ea6565b90969095509350505050565b60008060008060408587031215612f9657600080fd5b843567ffffffffffffffff80821115612fae57600080fd5b612fba88838901612ea6565b90965094506020870135915080821115612fd357600080fd5b50612fe087828801612ea6565b95989497509550505050565b80358015158114612ffc57600080fd5b919050565b60006020828403121561301357600080fd5b612e8682612fec565b6001600160a01b038116811461102c57600080fd5b60006020828403121561304357600080fd5b8135612e868161301c565b600081518084526020808501945080840160005b8381101561307e57815187529582019590820190600101613062565b509495945050505050565b600081518084526020808501945080840160005b8381101561307e5781516001600160a01b03168752958201959082019060010161309d565b600081518084526020808501945080840160005b8381101561307e57815163ffffffff16875295820195908201906001016130d6565b600081518084526020808501945080840160005b8381101561307e57815115158752958201959082019060010161310c565b60e08152600061313d60e083018a61304e565b828103602084015261314f818a613089565b905082810360408401526131638189613089565b9050828103606084015261317781886130c2565b9050828103608084015261318b81876130c2565b905082810360a084015261319f81866130f8565b905082810360c08401526131b381856130f8565b9a9950505050505050505050565b6000806000604084860312156131d657600080fd5b83356131e18161301c565b9250602084013567ffffffffffffffff811115612f2557600080fd5b608081526000613210608083018761304e565b6020830195909552506040810192909252606090910152919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561325557600080fd5b82356132608161301c565b9150602083013567ffffffffffffffff8082111561327d57600080fd5b818501915085601f83011261329157600080fd5b8135818111156132a3576132a361322c565b604051601f8201601f19908116603f011681019083821181831017156132cb576132cb61322c565b816040528281528860208487010111156132e457600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000806000806080858703121561331c57600080fd5b84359350602085013561332e8161301c565b925061333c60408601612fec565b9396929550929360600135925050565b60008060006060848603121561336157600080fd5b833561336c8161301c565b9250602084013561337c8161301c565b9150604084013561338c8161301c565b809150509250925092565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156133bf57600080fd5b5051919050565b600080604083850312156133d957600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417612e4757612e476133ea565b80820180821115612e4757612e476133ea565b60006020828403121561343c57600080fd5b8151612e868161301c565b81810381811115612e4757612e476133ea565b634e487b7160e01b600052603160045260246000fd5b60005b8381101561348b578181015183820152602001613473565b50506000910152565b600082516134a6818460208701613470565b9190910192915050565b60208152600082518060208401526134cf816040850160208701613470565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122064391ba99dc75f18345edd07ea3b78d539125b188e8a5afcec0ef638830970ee64736f6c63430008110033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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.