ETH Price: $3,300.68 (-3.26%)
Gas: 20 Gwei

Contract

0xB40E270C98d2F3D966A03DA5F56C034303645FA0
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
0x60806040174677872023-06-13 1:22:23386 days ago1686619343IN
 Create: Acrocalypse
0 ETH0.0732397714.67635965

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Acrocalypse

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion
File 1 of 24 : Acrocalypse.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
import "operator-filter-registry/src/upgradeable/DefaultOperatorFiltererUpgradeable.sol";

interface IERC721 {
    function transferFrom(address from, address to, uint256 tokenId) external;
}

interface IERC20 {
    function transfer(address to, uint256 amount) external returns (bool);
}

contract Acrocalypse is
    ERC721Upgradeable,
    OwnableUpgradeable,
    PausableUpgradeable,
    ReentrancyGuardUpgradeable,
    DefaultOperatorFiltererUpgradeable
{
    using StringsUpgradeable for uint256;
    using SafeMathUpgradeable for uint256;
    using SafeERC20Upgradeable for IERC20Upgradeable;

    string public baseURI;
    uint256 public maxSupply;
    uint256 public maxClaimPerTransaction;

    address private acrocalypseV1Address;

    // allow rewards until
    uint256 public allowRewardsEarningsUntil;

    // signer address for verification
    address public signerAddress;

    // paper token address
    IERC20 public paperTokenAddress;

    // Token Staking
    struct StakedToken {
        address owner;
        uint256 tokenId;
        uint256 stakePool;
        uint256 rewardsPerDay;
        uint256 pool1RewardsPerDay;
        uint256 creationTime;
        uint256 lockedUntilTime;
        uint256 lastClaimTime;
    }

    // Mapping to store all the tokens staked
    mapping(uint256 => StakedToken) public stakedTokens;

    uint256 public totalStaked;
    uint256 public totalPool1Staked;
    uint256 public totalPool2Staked;
    uint256 public totalPool3Staked;

    bool public enablePool1Staking;
    bool public enablePool2Staking;
    bool public enablePool3Staking;

    event Stake(uint256 indexed tokenId);
    event Unstake(uint256 indexed tokenId, uint256 stakedAtTimestamp, uint256 removedFromStakeAtTimestamp);

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

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    function initialize(address _acrocalypseV1Address, address _paperTokenAddress) external initializer {
        __ERC721_init("Acrocalypse", "ACROC");
        __Ownable_init();
        __Pausable_init();
        __ReentrancyGuard_init();
        DefaultOperatorFiltererUpgradeable.__DefaultOperatorFilterer_init();

        signerAddress = _msgSender();
        allowRewardsEarningsUntil = block.timestamp + 730 * 86400; // solhint-disable-line not-rely-on-time

        acrocalypseV1Address = _acrocalypseV1Address;
        paperTokenAddress = IERC20(_paperTokenAddress);

        baseURI = "ipfs://QmbEvQcsUzLdosWJpNXeCWxMYgfd595P9BRDWEqzAUuVQu/";
        maxSupply = 10420;
        maxClaimPerTransaction = 50;

        enablePool1Staking = true;
        enablePool2Staking = true;
        enablePool3Staking = true;
    }

    //external
    fallback() external payable {}

    receive() external payable {} // solhint-disable-line no-empty-blocks

    modifier callerIsUser() {
        require(!_isContract(_msgSender()), "Contract not allowed");
        // solhint-disable-next-line avoid-tx-origin
        require(_msgSender() == tx.origin, "Proxy contract not allowed");
        _;
    }

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

    /**
     * @dev Function to exchange v1 CROC NFT to v2
     */
    function claimV1NFT(uint256[] calldata tokenIds) external nonReentrant whenNotPaused callerIsUser {
        require(tokenIds.length <= maxClaimPerTransaction, "Beyond max claim limit");

        // Transfer and mint
        _claimV1NFT(tokenIds);
    }

    /**
     * @dev function to let admin mint for a wallet
     */
    function mintOwner(uint256[] calldata tokenIds, address to) external onlyOwner {
        for (uint256 i = 0; i < tokenIds.length; i++) {
            _mint(to, tokenIds[i]);
        }
    }

    /**
     * @dev Function to exchange v1 CROC NFT to v2 and also stake at the same time
     */
    function claimAndStakeV1NFT(
        bytes memory signature,
        uint256 stakePool,
        uint256[] calldata tokenIds,
        uint256[] calldata rewardsPerDay,
        uint256[] calldata pool1RewardsPerDay
    ) external nonReentrant whenNotPaused callerIsUser {
        require(tokenIds.length <= maxClaimPerTransaction, "Beyond max claim limit");

        // Transfer and mint
        _claimV1NFT(tokenIds);

        // Stake tokens
        stake(signature, stakePool, tokenIds, rewardsPerDay, pool1RewardsPerDay);
    }

    function _claimV1NFT(uint256[] memory tokenIds) internal {
        for (uint256 i = 0; i < tokenIds.length; i++) {
            IERC721(acrocalypseV1Address).transferFrom(_msgSender(), address(this), tokenIds[i]);
            _mint(_msgSender(), tokenIds[i]);
        }
    }

    /**
     * @dev function to stake NFTs
     */
    function stake(
        bytes memory signature,
        uint256 stakePool,
        uint256[] memory tokenIds,
        uint256[] memory rewardsPerDay,
        uint256[] memory pool1RewardsPerDay
    ) public payable whenNotPaused callerIsUser {
        require(block.timestamp < allowRewardsEarningsUntil, "Staking period expired"); // solhint-disable-line not-rely-on-time
        bytes32 hash = ECDSAUpgradeable.toEthSignedMessageHash(
            keccak256(abi.encodePacked(_msgSender(), stakePool, tokenIds, rewardsPerDay, pool1RewardsPerDay))
        );

        if (stakePool == 1) {
            require(enablePool1Staking, "Staking disabled");
        } else if (stakePool == 2) {
            require(enablePool2Staking, "Staking disabled");
        } else if (stakePool == 3) {
            require(enablePool3Staking, "Staking disabled");
        }

        // verifying the signature
        require(ECDSAUpgradeable.recover(hash, signature) == signerAddress, "Invalid Access");

        // token validation
        for (uint256 i = 0; i < tokenIds.length; i++) {
            // validating the token ids if already staked or not
            require(stakedTokens[tokenIds[i]].owner == address(0), "Token ID already staked");

            // validating the token ownership
            require(ownerOf(tokenIds[i]) == _msgSender(), "Token owner mismatch");

            uint256 lockedDays = 7; // pool 1
            uint256 lockedDaysTimePeriod = 604800;

            if (stakePool == 1) {
                totalPool1Staked++;
            } else if (stakePool == 2) {
                // pool 2
                lockedDays = 45;
                lockedDaysTimePeriod = 3888000;
                totalPool2Staked++;
            } else if (stakePool == 3) {
                // pool 3
                lockedDays = 90;
                lockedDaysTimePeriod = 7776000;
                totalPool3Staked++;
            }

            uint256 lockedUntil = block.timestamp + lockedDaysTimePeriod; // solhint-disable-line not-rely-on-time
            if (lockedUntil > allowRewardsEarningsUntil) {
                lockedUntil = allowRewardsEarningsUntil;
            }

            stakedTokens[tokenIds[i]] = StakedToken({
                owner: _msgSender(),
                tokenId: tokenIds[i],
                stakePool: stakePool,
                rewardsPerDay: rewardsPerDay[i],
                pool1RewardsPerDay: pool1RewardsPerDay[i],
                creationTime: block.timestamp, // solhint-disable-line not-rely-on-time
                lastClaimTime: 0,
                lockedUntilTime: lockedUntil
            });

            emit Stake(tokenIds[i]);
        }

        totalStaked += tokenIds.length;
    }

    function claim(uint256[] calldata tokenIds) external payable whenNotPaused callerIsUser {
        require(_claim(tokenIds, _msgSender(), false), "Error Claiming");
    }

    function claimAndUnstake(uint256[] calldata tokenIds) external payable whenNotPaused callerIsUser {
        bool claimStatus = _claim(tokenIds, _msgSender(), true);
        require(claimStatus, "Error Claiming");

        bool unstakeStatus = _unstake(tokenIds, _msgSender(), false);
        require(unstakeStatus, "Error Unstaking");
    }

    function unstakeAdmin(uint256[] calldata tokenIds) external onlyOwner {
        require(_unstake(tokenIds, address(0), true), "Error Unstaking");
    }

    function _claim(uint256[] memory tokenIds, address senderAddress, bool isUnstaking) internal returns (bool) {
        require(tokenIds.length > 0, "Token Ids not set");

        uint256 totalRewards = 0;

        for (uint256 i = 0; i < tokenIds.length; i++) {
            StakedToken memory sToken = stakedTokens[tokenIds[i]];

            // slither-disable-next-line incorrect-equality
            require(sToken.owner == senderAddress, "Invalid Token Access");

            totalRewards += calculateTokenUnclaimedRewards(tokenIds[i]);

            if (!isUnstaking) {
                // slither-disable-next-line incorrect-equality
                if (sToken.stakePool == 1) {
                    // extending the lock time by 7 days
                    uint256 lockedUntil = block.timestamp + 604800; // solhint-disable-line not-rely-on-time
                    if (lockedUntil > allowRewardsEarningsUntil) {
                        lockedUntil = allowRewardsEarningsUntil;
                    }
                    sToken.lockedUntilTime = lockedUntil;
                }

                sToken.lastClaimTime = block.timestamp; // solhint-disable-line not-rely-on-time
                stakedTokens[tokenIds[i]] = sToken;
            }
        }

        // Transfer the $PAPER Tokens
        bool success = paperTokenAddress.transfer(senderAddress, totalRewards.div(86400));
        require(success, "Unable to transfer tokens");

        return true;
    }

    function _unstake(uint256[] memory tokenIds, address senderAddress, bool isAdmin) internal returns (bool) {
        require(tokenIds.length > 0, "Token Ids not set");

        for (uint256 i = 0; i < tokenIds.length; i++) {
            StakedToken memory sToken = stakedTokens[tokenIds[i]];
            require(sToken.owner != address(0), "Token not staked");

            // only the Owner of the token or Admin can do unstaking
            if (!isAdmin) {
                // slither-disable-next-line incorrect-equality
                require(sToken.owner == senderAddress, "Invalid Token Access");
                require(sToken.lockedUntilTime <= block.timestamp, "Unable to unstake a locked token"); // solhint-disable-line not-rely-on-time
            }

            if (sToken.stakePool == 1) {
                totalPool1Staked--;
            } else if (sToken.stakePool == 2) {
                totalPool2Staked--;
            } else if (sToken.stakePool == 3) {
                totalPool3Staked--;
            }

            totalStaked--;
            delete stakedTokens[tokenIds[i]];

            emit Unstake(sToken.tokenId, sToken.creationTime, block.timestamp);
        }

        return true;
    }

    function calculateTokenUnclaimedRewards(uint256 tokenId) public view returns (uint256) {
        StakedToken memory sToken = stakedTokens[tokenId];
        require(sToken.owner != address(0), "Unstaked Token");

        // solhint-disable-next-line not-rely-on-time
        uint256 currentTimestamp = block.timestamp;
        uint256 rewardsUntilTimestamp = currentTimestamp > allowRewardsEarningsUntil ? allowRewardsEarningsUntil : currentTimestamp;

        uint256 claimStartTimestamp = sToken.lastClaimTime > 0 ? sToken.lastClaimTime : sToken.creationTime;
        // lastClaimTime is always updated with block.timestamp after claim
        if (claimStartTimestamp > rewardsUntilTimestamp) {
            claimStartTimestamp = rewardsUntilTimestamp;
        }

        uint256 timeDifference = 0;
        uint256 totalRewards = 0;

        if (sToken.stakePool == 2 || sToken.stakePool == 3) {
            if (rewardsUntilTimestamp <= sToken.lockedUntilTime) {
                timeDifference = rewardsUntilTimestamp - claimStartTimestamp;
                totalRewards = timeDifference.mul(sToken.rewardsPerDay);
            } else {
                if (claimStartTimestamp <= sToken.lockedUntilTime) {
                    timeDifference = sToken.lockedUntilTime - claimStartTimestamp;
                    totalRewards = timeDifference.mul(sToken.rewardsPerDay);

                    timeDifference = rewardsUntilTimestamp - sToken.lockedUntilTime;
                    totalRewards += timeDifference.mul(sToken.pool1RewardsPerDay);
                } else {
                    timeDifference = rewardsUntilTimestamp - claimStartTimestamp;
                    totalRewards = timeDifference.mul(sToken.pool1RewardsPerDay);
                }
            }
        } else if (sToken.stakePool == 1) {
            timeDifference = rewardsUntilTimestamp - claimStartTimestamp;
            totalRewards = timeDifference.mul(sToken.rewardsPerDay);
        }

        return totalRewards;
    }

    function stakedOwnerTokens(address owner) external view returns (StakedToken[] memory) {
        require(owner != address(0), "zero address");

        uint256 ownerTokenCount = balanceOf(owner);
        uint256 ownerStakedCount = 0;

        StakedToken[] memory ownerStakedTokens = new StakedToken[](ownerTokenCount);

        for (uint256 i = 0; i <= maxSupply && ownerStakedCount < ownerTokenCount; ++i) {
            if (stakedTokens[i].owner == owner) {
                ownerStakedTokens[ownerStakedCount] = stakedTokens[i];
                ownerStakedCount++;
            }
        }

        if (ownerTokenCount == ownerStakedCount) {
            return ownerStakedTokens;
        }

        StakedToken[] memory finalStakedTokens = new StakedToken[](ownerStakedCount);
        for (uint256 i = 0; i < ownerStakedCount; ++i) {
            if (ownerStakedTokens[i].owner == owner) {
                finalStakedTokens[i] = ownerStakedTokens[i];
            }
        }

        return finalStakedTokens;
    }

    function checkTokensStakedStatus(uint256[] calldata tokenIds) external view returns (bool[] memory stakedStatus) {
        require(tokenIds.length > 0 && tokenIds.length <= maxSupply, "Token Ids not set");

        bool[] memory tokenIdsStakedStatus = new bool[](tokenIds.length);
        for (uint256 i = 0; i < tokenIds.length; i++) {
            if (stakedTokens[tokenIds[i]].owner != address(0)) {
                tokenIdsStakedStatus[i] = true;
            }
        }
        return tokenIdsStakedStatus;
    }

    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "Invalid tokenId");
        return string(abi.encodePacked(baseURI, tokenId.toString(), ".json"));
    }

    function getTotalStakedCounters()
        external
        view
        returns (uint256 _totalStaked, uint256 _totalPool1Staked, uint256 _totalPool2Staked, uint256 _totalPool3Staked)
    {
        return (totalStaked, totalPool1Staked, totalPool2Staked, totalPool3Staked);
    }

    function pause() external onlyOwner {
        _pause();
    }

    function unpause() external onlyOwner {
        _unpause();
    }

    function setBaseTokenUri(string memory newBaseTokenUri) external onlyOwner {
        baseURI = newBaseTokenUri;
    }

    /**
     * @notice It allows the admin to set the signer address
     * @dev Only callable by owner.
     */
    function setSignerAddress(address newSignerAddress) external onlyOwner {
        if (address(newSignerAddress) != address(0)) {
            signerAddress = newSignerAddress;
        }
    }

    /**
     * @notice It allows the admin to set the contract address of V1 NFT
     * @dev Only callable by owner.
     */
    function setAcrocalypseV1Address(address newV1Address) external onlyOwner {
        if (address(newV1Address) != address(0)) {
            acrocalypseV1Address = newV1Address;
        }
    }

    function setPaperTokenAddress(address newAddress) external onlyOwner {
        if (address(newAddress) != address(0)) {
            paperTokenAddress = IERC20(newAddress);
        }
    }

    /**
     * @notice It allows the admin to set the max NFTs that be claimed in one transaction
     * @dev Only callable by owner.
     */
    function setMaxClaimPerTransaction(uint256 _maxClaimPerTransaction) external onlyOwner {
        maxClaimPerTransaction = _maxClaimPerTransaction;
    }

    function setTotalStakedCounters(
        uint256 _totalStaked,
        uint256 _totalPool1Staked,
        uint256 _totalPool2Staked,
        uint256 _totalPool3Staked
    ) external onlyOwner {
        totalStaked = _totalStaked;
        totalPool1Staked = _totalPool1Staked;
        totalPool2Staked = _totalPool2Staked;
        totalPool3Staked = _totalPool3Staked;
    }

    function setAllowRewardsEarningUntil(uint256 newAllowRewardsEarningsUntil) external onlyOwner {
        allowRewardsEarningsUntil = newAllowRewardsEarningsUntil;
    }

    function setEnablePool1Staking(bool _enablePoolStaking) external onlyOwner {
        enablePool1Staking = _enablePoolStaking;
    }

    function setEnablePool2Staking(bool _enablePoolStaking) external onlyOwner {
        enablePool2Staking = _enablePoolStaking;
    }

    function setEnablePool3Staking(bool _enablePoolStaking) external onlyOwner {
        enablePool3Staking = _enablePoolStaking;
    }

    /**
     * @notice It allows the admin to recover wrong tokens sent to the contract
     * @param tokenAddress: the address of the token to withdraw
     * @param tokenAmount: the number of token amount to withdraw
     * @dev Only callable by owner.
     */
    function recoverWrongTokens(address tokenAddress, uint256 tokenAmount) external onlyOwner {
        IERC20Upgradeable(tokenAddress).safeTransfer(address(_msgSender()), tokenAmount);
    }

    function withdraw(uint256 percentWithdrawl) external onlyOwner {
        require(address(this).balance > 0, "No funds available");
        require(percentWithdrawl > 0 && percentWithdrawl <= 100, "Invalid Withdrawl percent");

        AddressUpgradeable.sendValue(payable(owner()), (address(this).balance * percentWithdrawl) / 100);
    }

    /**
     * @notice Check if an address is a contract
     */
    function _isContract(address _addr) internal view returns (bool) {
        uint256 size;
        // slither-disable-next-line assembly
        assembly {
            size := extcodesize(_addr)
        }
        return size > 0;
    }

    function _beforeTokenTransfer(address from, address, uint256 tokenId, uint256) internal virtual override {
        // burning and transfer scenario when token is staked
        if (from != address(0)) {
            StakedToken memory sToken = stakedTokens[tokenId];
            require(sToken.owner == address(0), "Token staked");
        }
    }

    function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
        super.setApprovalForAll(operator, approved);
    }

    function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) {
        super.approve(operator, tokenId);
    }

    function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
        super.transferFrom(from, to, tokenId);
    }

    function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId);
    }

    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public override onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId, data);
    }
}

File 2 of 24 : 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 3 of 24 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (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.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    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.
     *
     * 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.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * 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.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    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.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 4 of 24 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

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

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

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

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

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

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

    /**
     * @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 5 of 24 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

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

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

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

    uint256 private _status;

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

    /**
     * @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 6 of 24 : draft-IERC20PermitUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20PermitUpgradeable {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 7 of 24 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

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

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

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

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

File 8 of 24 : SafeERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";
import "../extensions/draft-IERC20PermitUpgradeable.sol";
import "../../../utils/AddressUpgradeable.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20Upgradeable {
    using AddressUpgradeable for address;

    function safeTransfer(
        IERC20Upgradeable token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20Upgradeable token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20PermitUpgradeable token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 9 of 24 : ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.2) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC721_init_unchained(name_, symbol_);
    }

    function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
        _name = name_;
        _symbol = symbol_;
    }

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

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

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

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

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

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

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

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

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

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

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

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

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

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

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721Upgradeable.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721Upgradeable.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

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

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

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

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

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

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

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

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

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
     * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
     * that `ownerOf(tokenId)` is `a`.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __unsafe_increaseBalance(address account, uint256 amount) internal {
        _balances[account] += amount;
    }

    /**
     * @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[44] private __gap;
}

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

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

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

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

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

File 11 of 24 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

File 12 of 24 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

File 13 of 24 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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 14 of 24 : 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 15 of 24 : ECDSAUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../StringsUpgradeable.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSAUpgradeable {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

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

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @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 17 of 24 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 18 of 24 : MathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library MathUpgradeable {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

File 19 of 24 : SafeMathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 20 of 24 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = MathUpgradeable.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, MathUpgradeable.log256(value) + 1);
        }
    }

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

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 21 of 24 : IOperatorFilterRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
    /**
     * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns
     *         true if supplied registrant address is not registered.
     */
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);

    /**
     * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner.
     */
    function register(address registrant) external;

    /**
     * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes.
     */
    function registerAndSubscribe(address registrant, address subscription) external;

    /**
     * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another
     *         address without subscribing.
     */
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;

    /**
     * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner.
     *         Note that this does not remove any filtered addresses or codeHashes.
     *         Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes.
     */
    function unregister(address addr) external;

    /**
     * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered.
     */
    function updateOperator(address registrant, address operator, bool filtered) external;

    /**
     * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates.
     */
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;

    /**
     * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered.
     */
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;

    /**
     * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates.
     */
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;

    /**
     * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous
     *         subscription if present.
     *         Note that accounts with subscriptions may go on to subscribe to other accounts - in this case,
     *         subscriptions will not be forwarded. Instead the former subscription's existing entries will still be
     *         used.
     */
    function subscribe(address registrant, address registrantToSubscribe) external;

    /**
     * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes.
     */
    function unsubscribe(address registrant, bool copyExistingEntries) external;

    /**
     * @notice Get the subscription address of a given registrant, if any.
     */
    function subscriptionOf(address addr) external returns (address registrant);

    /**
     * @notice Get the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscribers(address registrant) external returns (address[] memory);

    /**
     * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscriberAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr.
     */
    function copyEntriesOf(address registrant, address registrantToCopy) external;

    /**
     * @notice Returns true if operator is filtered by a given address or its subscription.
     */
    function isOperatorFiltered(address registrant, address operator) external returns (bool);

    /**
     * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription.
     */
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);

    /**
     * @notice Returns true if a codeHash is filtered by a given address or its subscription.
     */
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);

    /**
     * @notice Returns a list of filtered operators for a given address or its subscription.
     */
    function filteredOperators(address addr) external returns (address[] memory);

    /**
     * @notice Returns the set of filtered codeHashes for a given address or its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);

    /**
     * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);

    /**
     * @notice Returns true if an address has registered
     */
    function isRegistered(address addr) external returns (bool);

    /**
     * @dev Convenience method to compute the code hash of an arbitrary contract
     */
    function codeHashOf(address addr) external returns (bytes32);
}

File 22 of 24 : Constants.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E;
address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;

File 23 of 24 : DefaultOperatorFiltererUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {OperatorFiltererUpgradeable} from "./OperatorFiltererUpgradeable.sol";
import {CANONICAL_CORI_SUBSCRIPTION} from "../lib/Constants.sol";

/**
 * @title  DefaultOperatorFiltererUpgradeable
 * @notice Inherits from OperatorFiltererUpgradeable and automatically subscribes to the default OpenSea subscription
 *         when the init function is called.
 */
abstract contract DefaultOperatorFiltererUpgradeable is OperatorFiltererUpgradeable {
    /// @dev The upgradeable initialize function that should be called when the contract is being deployed.
    function __DefaultOperatorFilterer_init() internal onlyInitializing {
        OperatorFiltererUpgradeable.__OperatorFilterer_init(CANONICAL_CORI_SUBSCRIPTION, true);
    }
}

File 24 of 24 : OperatorFiltererUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {IOperatorFilterRegistry} from "../IOperatorFilterRegistry.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

/**
 * @title  OperatorFiltererUpgradeable
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry when the init function is called.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 */
abstract contract OperatorFiltererUpgradeable is Initializable {
    /// @notice Emitted when an operator is not allowed.
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

    /// @dev The upgradeable initialize function that should be called when the contract is being upgraded.
    function __OperatorFilterer_init(address subscriptionOrRegistrantToCopy, bool subscribe)
        internal
        onlyInitializing
    {
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (!OPERATOR_FILTER_REGISTRY.isRegistered(address(this))) {
                if (subscribe) {
                    OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    if (subscriptionOrRegistrantToCopy != address(0)) {
                        OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                    } else {
                        OPERATOR_FILTER_REGISTRY.register(address(this));
                    }
                }
            }
        }
    }

    /**
     * @dev A helper modifier to check if the operator is allowed.
     */
    modifier onlyAllowedOperator(address from) virtual {
        // Allow spending tokens from addresses with balance
        // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
        // from an EOA.
        if (from != msg.sender) {
            _checkFilterOperator(msg.sender);
        }
        _;
    }

    /**
     * @dev A helper modifier to check if the operator approval is allowed.
     */
    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    /**
     * @dev A helper function to check if the operator is allowed.
     */
    function _checkFilterOperator(address operator) internal view virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            // under normal circumstances, this function will revert rather than return false, but inheriting or
            // upgraded contracts may specify their own OperatorFilterRegistry implementations, which may behave
            // differently
            if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakedAtTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"removedFromStakeAtTimestamp","type":"uint256"}],"name":"Unstake","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"allowRewardsEarningsUntil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"calculateTokenUnclaimedRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"checkTokensStakedStatus","outputs":[{"internalType":"bool[]","name":"stakedStatus","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"stakePool","type":"uint256"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"rewardsPerDay","type":"uint256[]"},{"internalType":"uint256[]","name":"pool1RewardsPerDay","type":"uint256[]"}],"name":"claimAndStakeV1NFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claimAndUnstake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claimV1NFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enablePool1Staking","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enablePool2Staking","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enablePool3Staking","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalStakedCounters","outputs":[{"internalType":"uint256","name":"_totalStaked","type":"uint256"},{"internalType":"uint256","name":"_totalPool1Staked","type":"uint256"},{"internalType":"uint256","name":"_totalPool2Staked","type":"uint256"},{"internalType":"uint256","name":"_totalPool3Staked","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_acrocalypseV1Address","type":"address"},{"internalType":"address","name":"_paperTokenAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxClaimPerTransaction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address","name":"to","type":"address"}],"name":"mintOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paperTokenAddress","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverWrongTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newV1Address","type":"address"}],"name":"setAcrocalypseV1Address","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newAllowRewardsEarningsUntil","type":"uint256"}],"name":"setAllowRewardsEarningUntil","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseTokenUri","type":"string"}],"name":"setBaseTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enablePoolStaking","type":"bool"}],"name":"setEnablePool1Staking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enablePoolStaking","type":"bool"}],"name":"setEnablePool2Staking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enablePoolStaking","type":"bool"}],"name":"setEnablePool3Staking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxClaimPerTransaction","type":"uint256"}],"name":"setMaxClaimPerTransaction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setPaperTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSignerAddress","type":"address"}],"name":"setSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalStaked","type":"uint256"},{"internalType":"uint256","name":"_totalPool1Staked","type":"uint256"},{"internalType":"uint256","name":"_totalPool2Staked","type":"uint256"},{"internalType":"uint256","name":"_totalPool3Staked","type":"uint256"}],"name":"setTotalStakedCounters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"stakePool","type":"uint256"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"rewardsPerDay","type":"uint256[]"},{"internalType":"uint256[]","name":"pool1RewardsPerDay","type":"uint256[]"}],"name":"stake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"stakedOwnerTokens","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"stakePool","type":"uint256"},{"internalType":"uint256","name":"rewardsPerDay","type":"uint256"},{"internalType":"uint256","name":"pool1RewardsPerDay","type":"uint256"},{"internalType":"uint256","name":"creationTime","type":"uint256"},{"internalType":"uint256","name":"lockedUntilTime","type":"uint256"},{"internalType":"uint256","name":"lastClaimTime","type":"uint256"}],"internalType":"struct Acrocalypse.StakedToken[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakedTokens","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"stakePool","type":"uint256"},{"internalType":"uint256","name":"rewardsPerDay","type":"uint256"},{"internalType":"uint256","name":"pool1RewardsPerDay","type":"uint256"},{"internalType":"uint256","name":"creationTime","type":"uint256"},{"internalType":"uint256","name":"lockedUntilTime","type":"uint256"},{"internalType":"uint256","name":"lastClaimTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPool1Staked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPool2Staked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPool3Staked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unstakeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"percentWithdrawl","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61590f80620000f46000396000f3fe60806040526004361061034a5760003560e01c80638a4ac900116101b9578063c22c294c116100f6578063e3e5d53d1161009a578063ef8e5d6c1161006c578063ef8e5d6c14610a75578063f2fde38b14610a95578063f76c145914610ab5578063f7ab032214610ad557005b8063e3e5d53d146109cc578063e7c93c33146109df578063e85eb93014610a0c578063e985e9c514610a2c57005b8063d5abeb01116100d3578063d5abeb0114610951578063de1ee94014610968578063ded48aa714610988578063e24547e8146109b557005b8063c22c294c146108fa578063c46024401461091a578063c87b56dd1461093157005b80639e8269b61161015d578063b2c15c011161013a578063b2c15c01146107ec578063b88d4fde1461080c578063c07885551461082c578063c16ab89f146108da57005b80639e8269b614610799578063a22cb465146107b9578063aadfb4da146107d957005b80638eae269b116101965780638eae269b1461072357806395652cfa1461074357806395d89b41146107635780639b103e671461077857005b80638a4ac900146106cd5780638aa20ecb146106ee5780638da5cb5b1461070557005b8063597dcd33116102875780636c0360eb1161022b578063715018a611610208578063715018a61461066c578063817b1cd2146106815780638239c297146106985780638456cb59146106b857005b80636c0360eb146106205780636d8f00e31461063557806370a082311461064c57005b80635e44790f116102645780635e44790f146105905780636352211e146105b0578063690e5125146105d05780636ba4c1381461060d57005b8063597dcd33146105375780635b7633d0146105575780635c975abb1461057857005b80632e1a7d4d116102ee5780633f4ba83a116102cb5780633f4ba83a146104c257806342842e0e146104d7578063485cc955146104f75780635269b5b91461051757005b80632e1a7d4d1461045d578063332751f21461047d5780633f138d4b146104a257005b8063081812fc11610327578063081812fc146103ca578063095ea7b31461040257806323b872dd146104225780632c1718e81461044257005b806301ffc9a714610353578063046dc1661461038857806306fdde03146103a857005b3661035157005b005b34801561035f57600080fd5b5061037361036e366004614e64565b610af5565b60405190151581526020015b60405180910390f35b34801561039457600080fd5b506103516103a3366004614e9d565b610b92565b3480156103b457600080fd5b506103bd610bc9565b60405161037f9190614f10565b3480156103d657600080fd5b506103ea6103e5366004614f23565b610c5b565b6040516001600160a01b03909116815260200161037f565b34801561040e57600080fd5b5061035161041d366004614f3c565b610c82565b34801561042e57600080fd5b5061035161043d366004614f66565b610c9b565b34801561044e57600080fd5b50610139546103739060ff1681565b34801561046957600080fd5b50610351610478366004614f23565b610cc6565b34801561048957600080fd5b506104946101315481565b60405190815260200161037f565b3480156104ae57600080fd5b506103516104bd366004614f3c565b610db0565b3480156104ce57600080fd5b50610351610dd0565b3480156104e357600080fd5b506103516104f2366004614f66565b610de2565b34801561050357600080fd5b50610351610512366004614fa2565b610e07565b34801561052357600080fd5b50610351610532366004614f23565b611074565b34801561054357600080fd5b50610351610552366004614e9d565b611082565b34801561056357600080fd5b50610132546103ea906001600160a01b031681565b34801561058457600080fd5b5060c95460ff16610373565b34801561059c57600080fd5b506103516105ab36600461501a565b6110ba565b3480156105bc57600080fd5b506103ea6105cb366004614f23565b611101565b3480156105dc57600080fd5b506101355461013654610137546101385460408051948552602085019390935291830152606082015260800161037f565b61035161061b36600461506e565b611166565b34801561062c57600080fd5b506103bd6112a8565b34801561064157600080fd5b506104946101385481565b34801561065857600080fd5b50610494610667366004614e9d565b611337565b34801561067857600080fd5b506103516113d1565b34801561068d57600080fd5b506104946101355481565b3480156106a457600080fd5b506104946106b3366004614f23565b6113e3565b3480156106c457600080fd5b50610351611605565b3480156106d957600080fd5b50610139546103739062010000900460ff1681565b3480156106fa57600080fd5b5061049461012f5481565b34801561071157600080fd5b506097546001600160a01b03166103ea565b34801561072f57600080fd5b5061035161073e36600461516f565b611615565b34801561074f57600080fd5b5061035161075e366004615237565b61180d565b34801561076f57600080fd5b506103bd611829565b34801561078457600080fd5b50610133546103ea906001600160a01b031681565b3480156107a557600080fd5b506103516107b4366004615280565b611838565b3480156107c557600080fd5b506103516107d43660046152c0565b611858565b6103516107e736600461506e565b61186c565b3480156107f857600080fd5b506101395461037390610100900460ff1681565b34801561081857600080fd5b506103516108273660046152f7565b611a49565b34801561083857600080fd5b50610895610847366004614f23565b61013460205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b03909616969495939492939192909188565b604080516001600160a01b0390991689526020890197909752958701949094526060860192909252608085015260a084015260c083015260e08201526101000161037f565b3480156108e657600080fd5b506103516108f536600461535f565b611a76565b34801561090657600080fd5b50610351610915366004614e9d565b611a92565b34801561092657600080fd5b506104946101365481565b34801561093d57600080fd5b506103bd61094c366004614f23565b611aca565b34801561095d57600080fd5b5061049461012e5481565b34801561097457600080fd5b5061035161098336600461506e565b611b64565b34801561099457600080fd5b506109a86109a3366004614e9d565b611bf7565b60405161037f919061537c565b3480156109c157600080fd5b506104946101375481565b6103516109da366004615487565b611f2e565b3480156109eb57600080fd5b506109ff6109fa36600461506e565b61259b565b60405161037f919061553e565b348015610a1857600080fd5b50610351610a2736600461535f565b6126cc565b348015610a3857600080fd5b50610373610a47366004614fa2565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b348015610a8157600080fd5b50610351610a9036600461535f565b61270d565b348015610aa157600080fd5b50610351610ab0366004614e9d565b612730565b348015610ac157600080fd5b50610351610ad0366004614f23565b6127bd565b348015610ae157600080fd5b50610351610af036600461506e565b6127cb565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480610b5857506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610b8c57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b610b9a612919565b6001600160a01b03811615610bc65761013280546001600160a01b0319166001600160a01b0383161790555b50565b606060658054610bd890615584565b80601f0160208091040260200160405190810160405280929190818152602001828054610c0490615584565b8015610c515780601f10610c2657610100808354040283529160200191610c51565b820191906000526020600020905b815481529060010190602001808311610c3457829003601f168201915b5050505050905090565b6000610c6682612973565b506000908152606960205260409020546001600160a01b031690565b81610c8c816129d7565b610c968383612ac2565b505050565b826001600160a01b0381163314610cb557610cb5336129d7565b610cc0848484612bee565b50505050565b610cce612919565b60004711610d235760405162461bcd60e51b815260206004820152601260248201527f4e6f2066756e647320617661696c61626c65000000000000000000000000000060448201526064015b60405180910390fd5b600081118015610d34575060648111155b610d805760405162461bcd60e51b815260206004820152601960248201527f496e76616c69642057697468647261776c2070657263656e74000000000000006044820152606401610d1a565b610bc6610d956097546001600160a01b031690565b6064610da184476155d4565b610dab91906155f3565b612c75565b610db8612919565b610dcc6001600160a01b0383163383612d92565b5050565b610dd8612919565b610de0612e12565b565b826001600160a01b0381163314610dfc57610dfc336129d7565b610cc0848484612e64565b600054610100900460ff1615808015610e275750600054600160ff909116105b80610e415750303b158015610e41575060005460ff166001145b610eb35760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610d1a565b6000805460ff191660011790558015610ed6576000805461ff0019166101001790555b610f4a6040518060400160405280600b81526020017f4163726f63616c797073650000000000000000000000000000000000000000008152506040518060400160405280600581526020017f4143524f43000000000000000000000000000000000000000000000000000000815250612e7f565b610f52612ef4565b610f5a612f67565b610f62612fda565b610f6a61304d565b61013280546001600160a01b03191633179055610f8b426303c26700615615565b6101315561013080546001600160a01b038086166001600160a01b031992831617909255610133805492851692909116919091179055604080516060810190915260368082526158a460208301398051610fee9161012d91602090910190614db5565b506128b461012e55603261012f5561013980547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000016620101011790558015610c96576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b61107c612919565b61012f55565b61108a612919565b6001600160a01b03811615610bc65761013080546001600160a01b0383166001600160a01b031990911617905550565b6110c2612919565b60005b82811015610cc0576110ef828585848181106110e3576110e361562d565b905060200201356130d7565b806110f981615643565b9150506110c5565b6000818152606760205260408120546001600160a01b031680610b8c5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610d1a565b61116e613270565b611179335b3b151590565b156111c65760405162461bcd60e51b815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f7765640000000000000000000000006044820152606401610d1a565b3332146112155760405162461bcd60e51b815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f7765640000000000006044820152606401610d1a565b61125c8282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506112559250612d8e915050565b60006132c3565b610dcc5760405162461bcd60e51b815260206004820152600e60248201527f4572726f7220436c61696d696e670000000000000000000000000000000000006044820152606401610d1a565b61012d80546112b690615584565b80601f01602080910402602001604051908101604052809291908181526020018280546112e290615584565b801561132f5780601f106113045761010080835404028352916020019161132f565b820191906000526020600020905b81548152906001019060200180831161131257829003601f168201915b505050505081565b60006001600160a01b0382166113b55760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610d1a565b506001600160a01b031660009081526068602052604090205490565b6113d9612919565b610de06000613616565b60008181526101346020908152604080832081516101008101835281546001600160a01b03168082526001830154948201949094526002820154928101929092526003810154606083015260048101546080830152600581015460a0830152600681015460c08301526007015460e0820152906114a25760405162461bcd60e51b815260206004820152600e60248201527f556e7374616b656420546f6b656e0000000000000000000000000000000000006044820152606401610d1a565b61013154429060009082116114b757816114bc565b610131545b90506000808460e00151116114d5578360a001516114db565b8360e001515b9050818111156114e85750805b600080856040015160021480611502575085604001516003145b156115c8578560c00151841161153c5761151c838561565d565b915061153586606001518361366890919063ffffffff16565b90506115fa565b8560c0015183116115a557828660c00151611557919061565d565b915061157086606001518361366890919063ffffffff16565b90508560c0015184611582919061565d565b915061159b86608001518361366890919063ffffffff16565b6115359082615615565b6115af838561565d565b915061153586608001518361366890919063ffffffff16565b85604001516001036115fa576115de838561565d565b91506115f786606001518361366890919063ffffffff16565b90505b979650505050505050565b61160d612919565b610de061367b565b61161d6136b8565b611625613270565b61162e33611173565b1561167b5760405162461bcd60e51b815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f7765640000000000000000000000006044820152606401610d1a565b3332146116ca5760405162461bcd60e51b815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f7765640000000000006044820152606401610d1a565b61012f5485111561171d5760405162461bcd60e51b815260206004820152601660248201527f4265796f6e64206d617820636c61696d206c696d6974000000000000000000006044820152606401610d1a565b61175986868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061371192505050565b6117f9888888888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a91829185019084908082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250611f2e92505050565b611803600160fb55565b5050505050505050565b611815612919565b8051610dcc9061012d906020840190614db5565b606060668054610bd890615584565b611840612919565b61013593909355610136919091556101375561013855565b81611862816129d7565b610c9683836137f7565b611874613270565b61187d33611173565b156118ca5760405162461bcd60e51b815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f7765640000000000000000000000006044820152606401610d1a565b3332146119195760405162461bcd60e51b815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f7765640000000000006044820152606401610d1a565b600061196283838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061195b9250612d8e915050565b60016132c3565b9050806119b15760405162461bcd60e51b815260206004820152600e60248201527f4572726f7220436c61696d696e670000000000000000000000000000000000006044820152606401610d1a565b60006119fa8484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506119f39250612d8e915050565b6000613802565b905080610cc05760405162461bcd60e51b815260206004820152600f60248201527f4572726f7220556e7374616b696e6700000000000000000000000000000000006044820152606401610d1a565b836001600160a01b0381163314611a6357611a63336129d7565b611a6f85858585613b51565b5050505050565b611a7e612919565b610139805460ff1916911515919091179055565b611a9a612919565b6001600160a01b03811615610bc65761013380546001600160a01b0383166001600160a01b031990911617905550565b6000818152606760205260409020546060906001600160a01b0316611b315760405162461bcd60e51b815260206004820152600f60248201527f496e76616c696420746f6b656e496400000000000000000000000000000000006044820152606401610d1a565b61012d611b3d83613bd9565b604051602001611b4e929190615690565b6040516020818303038152906040529050919050565b611b6c612919565b611bab82828080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250600191506138029050565b610dcc5760405162461bcd60e51b815260206004820152600f60248201527f4572726f7220556e7374616b696e6700000000000000000000000000000000006044820152606401610d1a565b60606001600160a01b038216611c4f5760405162461bcd60e51b815260206004820152600c60248201527f7a65726f206164647265737300000000000000000000000000000000000000006044820152606401610d1a565b6000611c5a83611337565b90506000808267ffffffffffffffff811115611c7857611c786150b0565b604051908082528060200260200182016040528015611cfa57816020015b611ce760405180610100016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081611c965790505b50905060005b61012e548111158015611d1257508383105b15611deb57600081815261013460205260409020546001600160a01b03808816911603611ddb576000818152610134602090815260409182902082516101008101845281546001600160a01b031681526001820154928101929092526002810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c082015260079091015460e08201528251839085908110611dc157611dc161562d565b60200260200101819052508280611dd790615643565b9350505b611de481615643565b9050611d00565b50818303611dfb57949350505050565b60008267ffffffffffffffff811115611e1657611e166150b0565b604051908082528060200260200182016040528015611e9857816020015b611e8560405180610100016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081611e345790505b50905060005b83811015611f2457866001600160a01b0316838281518110611ec257611ec261562d565b6020026020010151600001516001600160a01b031603611f1457828181518110611eee57611eee61562d565b6020026020010151828281518110611f0857611f0861562d565b60200260200101819052505b611f1d81615643565b9050611e9e565b5095945050505050565b611f36613270565b611f3f33611173565b15611f8c5760405162461bcd60e51b815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f7765640000000000000000000000006044820152606401610d1a565b333214611fdb5760405162461bcd60e51b815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f7765640000000000006044820152606401610d1a565b61013154421061202d5760405162461bcd60e51b815260206004820152601660248201527f5374616b696e6720706572696f642065787069726564000000000000000000006044820152606401610d1a565b60006120ab338686868660405160200161204b959493929190615795565b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b90508460010361210d576101395460ff166121085760405162461bcd60e51b815260206004820152601060248201527f5374616b696e672064697361626c6564000000000000000000000000000000006044820152606401610d1a565b6121ce565b8460020361216d5761013954610100900460ff166121085760405162461bcd60e51b815260206004820152601060248201527f5374616b696e672064697361626c6564000000000000000000000000000000006044820152606401610d1a565b846003036121ce576101395462010000900460ff166121ce5760405162461bcd60e51b815260206004820152601060248201527f5374616b696e672064697361626c6564000000000000000000000000000000006044820152606401610d1a565b610132546001600160a01b03166121e58288613c79565b6001600160a01b03161461223b5760405162461bcd60e51b815260206004820152600e60248201527f496e76616c6964204163636573730000000000000000000000000000000000006044820152606401610d1a565b60005b84518110156125795760006001600160a01b031661013460008784815181106122695761226961562d565b6020908102919091018101518252810191909152604001600020546001600160a01b0316146122da5760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20494420616c7265616479207374616b65640000000000000000006044820152606401610d1a565b336001600160a01b03166123068683815181106122f9576122f961562d565b6020026020010151611101565b6001600160a01b03161461235c5760405162461bcd60e51b815260206004820152601460248201527f546f6b656e206f776e6572206d69736d617463680000000000000000000000006044820152606401610d1a565b600762093a80600188900361238657610136805490600061237c83615643565b91905055506123d2565b876002036123a95750506101378054602d91623b53809190600061237c83615643565b876003036123d25750506101388054605a916276a700919060006123cc83615643565b91905055505b60006123de8242615615565b9050610131548111156123f15750610131545b6040518061010001604052806124043390565b6001600160a01b031681526020018986815181106124245761242461562d565b602002602001015181526020018a81526020018886815181106124495761244961562d565b602002602001015181526020018786815181106124685761246861562d565b60200260200101518152602001428152602001828152602001600081525061013460008a878151811061249d5761249d61562d565b6020908102919091018101518252818101929092526040908101600020835181546001600160a01b0319166001600160a01b039091161781559183015160018301558201516002820155606082015160038201556080820151600482015560a0820151600582015560c0820151600682015560e090910151600790910155875188908590811061252f5761252f61562d565b60200260200101517f227a473b70d2f893cc7659219575c030a63b5743024fe1e0c1a680e708b1525a60405160405180910390a2505050808061257190615643565b91505061223e565b508351610135600082825461258e9190615615565b9091555050505050505050565b606081158015906125af575061012e548211155b6125fb5760405162461bcd60e51b815260206004820152601160248201527f546f6b656e20496473206e6f74207365740000000000000000000000000000006044820152606401610d1a565b60008267ffffffffffffffff811115612616576126166150b0565b60405190808252806020026020018201604052801561263f578160200160208202803683370190505b50905060005b838110156126c4576000610134818787858181106126655761266561562d565b60209081029290920135835250810191909152604001600020546001600160a01b0316146126b25760018282815181106126a1576126a161562d565b911515602092830291909101909101525b806126bc81615643565b915050612645565b509392505050565b6126d4612919565b610139805491151562010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff909216919091179055565b612715612919565b61013980549115156101000261ff0019909216919091179055565b612738612919565b6001600160a01b0381166127b45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d1a565b610bc681613616565b6127c5612919565b61013155565b6127d36136b8565b6127db613270565b6127e433611173565b156128315760405162461bcd60e51b815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f7765640000000000000000000000006044820152606401610d1a565b3332146128805760405162461bcd60e51b815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f7765640000000000006044820152606401610d1a565b61012f548111156128d35760405162461bcd60e51b815260206004820152601660248201527f4265796f6e64206d617820636c61696d206c696d6974000000000000000000006044820152606401610d1a565b61290f82828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061371192505050565b610dcc600160fb55565b6097546001600160a01b03163314610de05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d1a565b6000818152606760205260409020546001600160a01b0316610bc65760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610d1a565b6daaeb6d7670e522a718067333cd4e3b15610bc6576040517fc61711340000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015612a5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a8191906157e4565b610bc6576040517fede71dcc0000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602401610d1a565b6000612acd82611101565b9050806001600160a01b0316836001600160a01b031603612b565760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610d1a565b336001600160a01b0382161480612b725750612b728133610a47565b612be45760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610d1a565b610c968383613c95565b612bf83382613d03565b612c6a5760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608401610d1a565b610c96838383613d82565b80471015612cc55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610d1a565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612d12576040519150601f19603f3d011682016040523d82523d6000602084013e612d17565b606091505b5050905080610c965760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610d1a565b3390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610c96908490613fb8565b612e1a61409d565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610c9683838360405180602001604052806000815250611a49565b600054610100900460ff16612eea5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b610dcc82826140ef565b600054610100900460ff16612f5f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b610de0614181565b600054610100900460ff16612fd25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b610de06141f5565b600054610100900460ff166130455760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b610de061426c565b600054610100900460ff166130b85760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b610de0733cc6cdda760b79bafa08df41ecfa224f810dceb660016142d7565b6001600160a01b03821661312d5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610d1a565b6000818152606760205260409020546001600160a01b0316156131925760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610d1a565b6131a0600083836001614526565b6000818152606760205260409020546001600160a01b0316156132055760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610d1a565b6001600160a01b038216600081815260686020908152604080832080546001019055848352606790915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60c95460ff1615610de05760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610d1a565b6000808451116133155760405162461bcd60e51b815260206004820152601160248201527f546f6b656e20496473206e6f74207365740000000000000000000000000000006044820152606401610d1a565b6000805b8551811015613528576000610134600088848151811061333b5761333b61562d565b602090810291909101810151825281810192909252604090810160002081516101008101835281546001600160a01b039081168083526001840154958301959095526002830154938201939093526003820154606082015260048201546080820152600582015460a0820152600682015460c082015260079091015460e0820152925087161461340d5760405162461bcd60e51b815260206004820152601460248201527f496e76616c696420546f6b656e204163636573730000000000000000000000006044820152606401610d1a565b61342f8783815181106134225761342261562d565b60200260200101516113e3565b6134399084615615565b92508461351557806040015160010361347457600061345b4262093a80615615565b90506101315481111561346e5750610131545b60c08201525b428160e00181815250508061013460008985815181106134965761349661562d565b6020908102919091018101518252818101929092526040908101600020835181546001600160a01b0319166001600160a01b039091161781559183015160018301558201516002820155606082015160038201556080820151600482015560a0820151600582015560c0820151600682015560e0909101516007909101555b508061352081615643565b915050613319565b50610133546000906001600160a01b031663a9059cbb8661354c85620151806145f5565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015613597573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135bb91906157e4565b90508061360a5760405162461bcd60e51b815260206004820152601960248201527f556e61626c6520746f207472616e7366657220746f6b656e73000000000000006044820152606401610d1a565b50600195945050505050565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600061367482846155d4565b9392505050565b613683613270565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612e473390565b600260fb540361370a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d1a565b600260fb55565b60005b8151811015610dcc57610130546001600160a01b03166323b872dd33308585815181106137435761374361562d565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561379d57600080fd5b505af11580156137b1573d6000803e3d6000fd5b505050506137de6137bf3390565b8383815181106137d1576137d161562d565b60200260200101516130d7565b806137e881615643565b915050613714565b600160fb55565b610dcc338383614601565b6000808451116138545760405162461bcd60e51b815260206004820152601160248201527f546f6b656e20496473206e6f74207365740000000000000000000000000000006044820152606401610d1a565b60005b8451811015613b4657600061013460008784815181106138795761387961562d565b602090810291909101810151825281810192909252604090810160002081516101008101835281546001600160a01b03168082526001830154948201949094526002820154928101929092526003810154606083015260048101546080830152600581015460a0830152600681015460c08301526007015460e082015291506139445760405162461bcd60e51b815260206004820152601060248201527f546f6b656e206e6f74207374616b6564000000000000000000000000000000006044820152606401610d1a565b83613a0257846001600160a01b031681600001516001600160a01b0316146139ae5760405162461bcd60e51b815260206004820152601460248201527f496e76616c696420546f6b656e204163636573730000000000000000000000006044820152606401610d1a565b428160c001511115613a025760405162461bcd60e51b815260206004820181905260248201527f556e61626c6520746f20756e7374616b652061206c6f636b656420746f6b656e6044820152606401610d1a565b8060400151600103613a29576101368054906000613a1f83615801565b9190505550613a69565b8060400151600203613a46576101378054906000613a1f83615801565b8060400151600303613a69576101388054906000613a6383615801565b91905055505b6101358054906000613a7a83615801565b91905055506101346000878481518110613a9657613a9661562d565b6020908102919091018101518252818101929092526040908101600090812080546001600160a01b0319168155600181018290556002810182905560038101829055600481018290556005810182905560068101829055600701558282015160a084015182519081524293810193909352917f529f395783b74aeb16a02d6320297d8415f7312f2ff2c398cd0d70e30bebc6c9910160405180910390a25080613b3e81615643565b915050613857565b506001949350505050565b613b5b3383613d03565b613bcd5760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608401610d1a565b610cc0848484846146cf565b60606000613be683614758565b600101905060008167ffffffffffffffff811115613c0657613c066150b0565b6040519080825280601f01601f191660200182016040528015613c30576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084613c3a57509392505050565b6000806000613c88858561483a565b915091506126c48161487f565b600081815260696020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613cca82611101565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080613d0f83611101565b9050806001600160a01b0316846001600160a01b03161480613d5657506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b80613d7a5750836001600160a01b0316613d6f84610c5b565b6001600160a01b0316145b949350505050565b826001600160a01b0316613d9582611101565b6001600160a01b031614613e115760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610d1a565b6001600160a01b038216613e8c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610d1a565b613e998383836001614526565b826001600160a01b0316613eac82611101565b6001600160a01b031614613f285760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610d1a565b600081815260696020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260688552838620805460001901905590871680865283862080546001019055868652606790945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600061400d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166149e49092919063ffffffff16565b805190915015610c96578080602001905181019061402b91906157e4565b610c965760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d1a565b60c95460ff16610de05760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610d1a565b600054610100900460ff1661415a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b815161416d906065906020850190614db5565b508051610c96906066906020840190614db5565b600054610100900460ff166141ec5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b610de033613616565b600054610100900460ff166142605760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b60c9805460ff19169055565b600054610100900460ff166137f05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b600054610100900460ff166143425760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b6daaeb6d7670e522a718067333cd4e3b15610dcc576040517fc3c5a5470000000000000000000000000000000000000000000000000000000081523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af11580156143bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143df91906157e4565b610dcc578015614474576040517f7d3e3dbe0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b15801561445857600080fd5b505af115801561446c573d6000803e3d6000fd5b505050505050565b6001600160a01b038216156144dc576040517fa0af29030000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440161443e565b6040517f4420e4860000000000000000000000000000000000000000000000000000000081523060048201526daaeb6d7670e522a718067333cd4e90634420e4869060240161443e565b6001600160a01b03841615610cc0576000828152610134602090815260409182902082516101008101845281546001600160a01b03168082526001830154938201939093526002820154938101939093526003810154606084015260048101546080840152600581015460a0840152600681015460c08401526007015460e083015215611a6f5760405162461bcd60e51b815260206004820152600c60248201527f546f6b656e207374616b656400000000000000000000000000000000000000006044820152606401610d1a565b600061367482846155f3565b816001600160a01b0316836001600160a01b0316036146625760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610d1a565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6146da848484613d82565b6146e6848484846149f3565b610cc05760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610d1a565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106147a1577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106147cd576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106147eb57662386f26fc10000830492506010015b6305f5e1008310614803576305f5e100830492506008015b612710831061481757612710830492506004015b60648310614829576064830492506002015b600a8310610b8c5760010192915050565b60008082516041036148705760208301516040840151606085015160001a61486487828585614b71565b94509450505050614878565b506000905060025b9250929050565b600081600481111561489357614893615818565b0361489b5750565b60018160048111156148af576148af615818565b036148fc5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610d1a565b600281600481111561491057614910615818565b0361495d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610d1a565b600381600481111561497157614971615818565b03610bc65760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610d1a565b6060613d7a8484600085614c35565b60006001600160a01b0384163b15613b46576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a0290614a5090339089908890889060040161582e565b6020604051808303816000875af1925050508015614a8b575060408051601f3d908101601f19168201909252614a889181019061586a565b60015b614b3e573d808015614ab9576040519150601f19603f3d011682016040523d82523d6000602084013e614abe565b606091505b508051600003614b365760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610d1a565b805181602001fd5b6001600160e01b0319167f150b7a0200000000000000000000000000000000000000000000000000000000149050613d7a565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614ba85750600090506003614c2c565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614bfc573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614c2557600060019250925050614c2c565b9150600090505b94509492505050565b606082471015614cad5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d1a565b600080866001600160a01b03168587604051614cc99190615887565b60006040518083038185875af1925050503d8060008114614d06576040519150601f19603f3d011682016040523d82523d6000602084013e614d0b565b606091505b50915091506115fa8783838760608315614d86578251600003614d7f576001600160a01b0385163b614d7f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d1a565b5081613d7a565b613d7a8383815115614d9b5781518083602001fd5b8060405162461bcd60e51b8152600401610d1a9190614f10565b828054614dc190615584565b90600052602060002090601f016020900481019282614de35760008555614e29565b82601f10614dfc57805160ff1916838001178555614e29565b82800160010185558215614e29579182015b82811115614e29578251825591602001919060010190614e0e565b50614e35929150614e39565b5090565b5b80821115614e355760008155600101614e3a565b6001600160e01b031981168114610bc657600080fd5b600060208284031215614e7657600080fd5b813561367481614e4e565b80356001600160a01b0381168114614e9857600080fd5b919050565b600060208284031215614eaf57600080fd5b61367482614e81565b60005b83811015614ed3578181015183820152602001614ebb565b83811115610cc05750506000910152565b60008151808452614efc816020860160208601614eb8565b601f01601f19169290920160200192915050565b6020815260006136746020830184614ee4565b600060208284031215614f3557600080fd5b5035919050565b60008060408385031215614f4f57600080fd5b614f5883614e81565b946020939093013593505050565b600080600060608486031215614f7b57600080fd5b614f8484614e81565b9250614f9260208501614e81565b9150604084013590509250925092565b60008060408385031215614fb557600080fd5b614fbe83614e81565b9150614fcc60208401614e81565b90509250929050565b60008083601f840112614fe757600080fd5b50813567ffffffffffffffff811115614fff57600080fd5b6020830191508360208260051b850101111561487857600080fd5b60008060006040848603121561502f57600080fd5b833567ffffffffffffffff81111561504657600080fd5b61505286828701614fd5565b9094509250615065905060208501614e81565b90509250925092565b6000806020838503121561508157600080fd5b823567ffffffffffffffff81111561509857600080fd5b6150a485828601614fd5565b90969095509350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156150ef576150ef6150b0565b604052919050565b600067ffffffffffffffff831115615111576151116150b0565b6151246020601f19601f860116016150c6565b905082815283838301111561513857600080fd5b828260208301376000602084830101529392505050565b600082601f83011261516057600080fd5b613674838335602085016150f7565b60008060008060008060008060a0898b03121561518b57600080fd5b883567ffffffffffffffff808211156151a357600080fd5b6151af8c838d0161514f565b995060208b0135985060408b01359150808211156151cc57600080fd5b6151d88c838d01614fd5565b909850965060608b01359150808211156151f157600080fd5b6151fd8c838d01614fd5565b909650945060808b013591508082111561521657600080fd5b506152238b828c01614fd5565b999c989b5096995094979396929594505050565b60006020828403121561524957600080fd5b813567ffffffffffffffff81111561526057600080fd5b8201601f8101841361527157600080fd5b613d7a848235602084016150f7565b6000806000806080858703121561529657600080fd5b5050823594602084013594506040840135936060013592509050565b8015158114610bc657600080fd5b600080604083850312156152d357600080fd5b6152dc83614e81565b915060208301356152ec816152b2565b809150509250929050565b6000806000806080858703121561530d57600080fd5b61531685614e81565b935061532460208601614e81565b925060408501359150606085013567ffffffffffffffff81111561534757600080fd5b6153538782880161514f565b91505092959194509250565b60006020828403121561537157600080fd5b8135613674816152b2565b602080825282518282018190526000919060409081850190868401855b8281101561540557815180516001600160a01b0316855286810151878601528581015186860152606080820151908601526080808201519086015260a0808201519086015260c0808201519086015260e090810151908501526101009093019290850190600101615399565b5091979650505050505050565b600082601f83011261542357600080fd5b8135602067ffffffffffffffff82111561543f5761543f6150b0565b8160051b61544e8282016150c6565b928352848101820192828101908785111561546857600080fd5b83870192505b848310156115fa5782358252918301919083019061546e565b600080600080600060a0868803121561549f57600080fd5b853567ffffffffffffffff808211156154b757600080fd5b6154c389838a0161514f565b96506020880135955060408801359150808211156154e057600080fd5b6154ec89838a01615412565b9450606088013591508082111561550257600080fd5b61550e89838a01615412565b9350608088013591508082111561552457600080fd5b5061553188828901615412565b9150509295509295909350565b6020808252825182820181905260009190848201906040850190845b8181101561557857835115158352928401929184019160010161555a565b50909695505050505050565b600181811c9082168061559857607f821691505b6020821081036155b857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156155ee576155ee6155be565b500290565b60008261561057634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115615628576156286155be565b500190565b634e487b7160e01b600052603260045260246000fd5b60006000198203615656576156566155be565b5060010190565b60008282101561566f5761566f6155be565b500390565b60008151615686818560208601614eb8565b9290920192915050565b600080845481600182811c9150808316806156ac57607f831692505b602080841082036156cb57634e487b7160e01b86526022600452602486fd5b8180156156df57600181146156f05761571d565b60ff1986168952848901965061571d565b60008b81526020902060005b868110156157155781548b8201529085019083016156fc565b505084890196505b5050505050506157596157308286615674565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050190565b95945050505050565b60008151602080840160005b8381101561578a5781518752958201959082019060010161576e565b509495945050505050565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008660601b16815284601482015260006115fa6157de6157d86034850188615762565b86615762565b84615762565b6000602082840312156157f657600080fd5b8151613674816152b2565b600081615810576158106155be565b506000190190565b634e487b7160e01b600052602160045260246000fd5b60006001600160a01b038087168352808616602084015250836040830152608060608301526158606080830184614ee4565b9695505050505050565b60006020828403121561587c57600080fd5b815161367481614e4e565b60008251615899818460208701614eb8565b919091019291505056fe697066733a2f2f516d624576516373557a4c646f73574a704e58654357784d5967666435393550394252445745717a4155755651752fa26469706673582212204e796e261f44d1e682e205b6b89fb7142232475660f35f8e1f7d30af1fdf34f764736f6c634300080d0033

Deployed Bytecode

0x60806040526004361061034a5760003560e01c80638a4ac900116101b9578063c22c294c116100f6578063e3e5d53d1161009a578063ef8e5d6c1161006c578063ef8e5d6c14610a75578063f2fde38b14610a95578063f76c145914610ab5578063f7ab032214610ad557005b8063e3e5d53d146109cc578063e7c93c33146109df578063e85eb93014610a0c578063e985e9c514610a2c57005b8063d5abeb01116100d3578063d5abeb0114610951578063de1ee94014610968578063ded48aa714610988578063e24547e8146109b557005b8063c22c294c146108fa578063c46024401461091a578063c87b56dd1461093157005b80639e8269b61161015d578063b2c15c011161013a578063b2c15c01146107ec578063b88d4fde1461080c578063c07885551461082c578063c16ab89f146108da57005b80639e8269b614610799578063a22cb465146107b9578063aadfb4da146107d957005b80638eae269b116101965780638eae269b1461072357806395652cfa1461074357806395d89b41146107635780639b103e671461077857005b80638a4ac900146106cd5780638aa20ecb146106ee5780638da5cb5b1461070557005b8063597dcd33116102875780636c0360eb1161022b578063715018a611610208578063715018a61461066c578063817b1cd2146106815780638239c297146106985780638456cb59146106b857005b80636c0360eb146106205780636d8f00e31461063557806370a082311461064c57005b80635e44790f116102645780635e44790f146105905780636352211e146105b0578063690e5125146105d05780636ba4c1381461060d57005b8063597dcd33146105375780635b7633d0146105575780635c975abb1461057857005b80632e1a7d4d116102ee5780633f4ba83a116102cb5780633f4ba83a146104c257806342842e0e146104d7578063485cc955146104f75780635269b5b91461051757005b80632e1a7d4d1461045d578063332751f21461047d5780633f138d4b146104a257005b8063081812fc11610327578063081812fc146103ca578063095ea7b31461040257806323b872dd146104225780632c1718e81461044257005b806301ffc9a714610353578063046dc1661461038857806306fdde03146103a857005b3661035157005b005b34801561035f57600080fd5b5061037361036e366004614e64565b610af5565b60405190151581526020015b60405180910390f35b34801561039457600080fd5b506103516103a3366004614e9d565b610b92565b3480156103b457600080fd5b506103bd610bc9565b60405161037f9190614f10565b3480156103d657600080fd5b506103ea6103e5366004614f23565b610c5b565b6040516001600160a01b03909116815260200161037f565b34801561040e57600080fd5b5061035161041d366004614f3c565b610c82565b34801561042e57600080fd5b5061035161043d366004614f66565b610c9b565b34801561044e57600080fd5b50610139546103739060ff1681565b34801561046957600080fd5b50610351610478366004614f23565b610cc6565b34801561048957600080fd5b506104946101315481565b60405190815260200161037f565b3480156104ae57600080fd5b506103516104bd366004614f3c565b610db0565b3480156104ce57600080fd5b50610351610dd0565b3480156104e357600080fd5b506103516104f2366004614f66565b610de2565b34801561050357600080fd5b50610351610512366004614fa2565b610e07565b34801561052357600080fd5b50610351610532366004614f23565b611074565b34801561054357600080fd5b50610351610552366004614e9d565b611082565b34801561056357600080fd5b50610132546103ea906001600160a01b031681565b34801561058457600080fd5b5060c95460ff16610373565b34801561059c57600080fd5b506103516105ab36600461501a565b6110ba565b3480156105bc57600080fd5b506103ea6105cb366004614f23565b611101565b3480156105dc57600080fd5b506101355461013654610137546101385460408051948552602085019390935291830152606082015260800161037f565b61035161061b36600461506e565b611166565b34801561062c57600080fd5b506103bd6112a8565b34801561064157600080fd5b506104946101385481565b34801561065857600080fd5b50610494610667366004614e9d565b611337565b34801561067857600080fd5b506103516113d1565b34801561068d57600080fd5b506104946101355481565b3480156106a457600080fd5b506104946106b3366004614f23565b6113e3565b3480156106c457600080fd5b50610351611605565b3480156106d957600080fd5b50610139546103739062010000900460ff1681565b3480156106fa57600080fd5b5061049461012f5481565b34801561071157600080fd5b506097546001600160a01b03166103ea565b34801561072f57600080fd5b5061035161073e36600461516f565b611615565b34801561074f57600080fd5b5061035161075e366004615237565b61180d565b34801561076f57600080fd5b506103bd611829565b34801561078457600080fd5b50610133546103ea906001600160a01b031681565b3480156107a557600080fd5b506103516107b4366004615280565b611838565b3480156107c557600080fd5b506103516107d43660046152c0565b611858565b6103516107e736600461506e565b61186c565b3480156107f857600080fd5b506101395461037390610100900460ff1681565b34801561081857600080fd5b506103516108273660046152f7565b611a49565b34801561083857600080fd5b50610895610847366004614f23565b61013460205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b03909616969495939492939192909188565b604080516001600160a01b0390991689526020890197909752958701949094526060860192909252608085015260a084015260c083015260e08201526101000161037f565b3480156108e657600080fd5b506103516108f536600461535f565b611a76565b34801561090657600080fd5b50610351610915366004614e9d565b611a92565b34801561092657600080fd5b506104946101365481565b34801561093d57600080fd5b506103bd61094c366004614f23565b611aca565b34801561095d57600080fd5b5061049461012e5481565b34801561097457600080fd5b5061035161098336600461506e565b611b64565b34801561099457600080fd5b506109a86109a3366004614e9d565b611bf7565b60405161037f919061537c565b3480156109c157600080fd5b506104946101375481565b6103516109da366004615487565b611f2e565b3480156109eb57600080fd5b506109ff6109fa36600461506e565b61259b565b60405161037f919061553e565b348015610a1857600080fd5b50610351610a2736600461535f565b6126cc565b348015610a3857600080fd5b50610373610a47366004614fa2565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b348015610a8157600080fd5b50610351610a9036600461535f565b61270d565b348015610aa157600080fd5b50610351610ab0366004614e9d565b612730565b348015610ac157600080fd5b50610351610ad0366004614f23565b6127bd565b348015610ae157600080fd5b50610351610af036600461506e565b6127cb565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480610b5857506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610b8c57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b610b9a612919565b6001600160a01b03811615610bc65761013280546001600160a01b0319166001600160a01b0383161790555b50565b606060658054610bd890615584565b80601f0160208091040260200160405190810160405280929190818152602001828054610c0490615584565b8015610c515780601f10610c2657610100808354040283529160200191610c51565b820191906000526020600020905b815481529060010190602001808311610c3457829003601f168201915b5050505050905090565b6000610c6682612973565b506000908152606960205260409020546001600160a01b031690565b81610c8c816129d7565b610c968383612ac2565b505050565b826001600160a01b0381163314610cb557610cb5336129d7565b610cc0848484612bee565b50505050565b610cce612919565b60004711610d235760405162461bcd60e51b815260206004820152601260248201527f4e6f2066756e647320617661696c61626c65000000000000000000000000000060448201526064015b60405180910390fd5b600081118015610d34575060648111155b610d805760405162461bcd60e51b815260206004820152601960248201527f496e76616c69642057697468647261776c2070657263656e74000000000000006044820152606401610d1a565b610bc6610d956097546001600160a01b031690565b6064610da184476155d4565b610dab91906155f3565b612c75565b610db8612919565b610dcc6001600160a01b0383163383612d92565b5050565b610dd8612919565b610de0612e12565b565b826001600160a01b0381163314610dfc57610dfc336129d7565b610cc0848484612e64565b600054610100900460ff1615808015610e275750600054600160ff909116105b80610e415750303b158015610e41575060005460ff166001145b610eb35760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610d1a565b6000805460ff191660011790558015610ed6576000805461ff0019166101001790555b610f4a6040518060400160405280600b81526020017f4163726f63616c797073650000000000000000000000000000000000000000008152506040518060400160405280600581526020017f4143524f43000000000000000000000000000000000000000000000000000000815250612e7f565b610f52612ef4565b610f5a612f67565b610f62612fda565b610f6a61304d565b61013280546001600160a01b03191633179055610f8b426303c26700615615565b6101315561013080546001600160a01b038086166001600160a01b031992831617909255610133805492851692909116919091179055604080516060810190915260368082526158a460208301398051610fee9161012d91602090910190614db5565b506128b461012e55603261012f5561013980547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000016620101011790558015610c96576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b61107c612919565b61012f55565b61108a612919565b6001600160a01b03811615610bc65761013080546001600160a01b0383166001600160a01b031990911617905550565b6110c2612919565b60005b82811015610cc0576110ef828585848181106110e3576110e361562d565b905060200201356130d7565b806110f981615643565b9150506110c5565b6000818152606760205260408120546001600160a01b031680610b8c5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610d1a565b61116e613270565b611179335b3b151590565b156111c65760405162461bcd60e51b815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f7765640000000000000000000000006044820152606401610d1a565b3332146112155760405162461bcd60e51b815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f7765640000000000006044820152606401610d1a565b61125c8282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506112559250612d8e915050565b60006132c3565b610dcc5760405162461bcd60e51b815260206004820152600e60248201527f4572726f7220436c61696d696e670000000000000000000000000000000000006044820152606401610d1a565b61012d80546112b690615584565b80601f01602080910402602001604051908101604052809291908181526020018280546112e290615584565b801561132f5780601f106113045761010080835404028352916020019161132f565b820191906000526020600020905b81548152906001019060200180831161131257829003601f168201915b505050505081565b60006001600160a01b0382166113b55760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610d1a565b506001600160a01b031660009081526068602052604090205490565b6113d9612919565b610de06000613616565b60008181526101346020908152604080832081516101008101835281546001600160a01b03168082526001830154948201949094526002820154928101929092526003810154606083015260048101546080830152600581015460a0830152600681015460c08301526007015460e0820152906114a25760405162461bcd60e51b815260206004820152600e60248201527f556e7374616b656420546f6b656e0000000000000000000000000000000000006044820152606401610d1a565b61013154429060009082116114b757816114bc565b610131545b90506000808460e00151116114d5578360a001516114db565b8360e001515b9050818111156114e85750805b600080856040015160021480611502575085604001516003145b156115c8578560c00151841161153c5761151c838561565d565b915061153586606001518361366890919063ffffffff16565b90506115fa565b8560c0015183116115a557828660c00151611557919061565d565b915061157086606001518361366890919063ffffffff16565b90508560c0015184611582919061565d565b915061159b86608001518361366890919063ffffffff16565b6115359082615615565b6115af838561565d565b915061153586608001518361366890919063ffffffff16565b85604001516001036115fa576115de838561565d565b91506115f786606001518361366890919063ffffffff16565b90505b979650505050505050565b61160d612919565b610de061367b565b61161d6136b8565b611625613270565b61162e33611173565b1561167b5760405162461bcd60e51b815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f7765640000000000000000000000006044820152606401610d1a565b3332146116ca5760405162461bcd60e51b815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f7765640000000000006044820152606401610d1a565b61012f5485111561171d5760405162461bcd60e51b815260206004820152601660248201527f4265796f6e64206d617820636c61696d206c696d6974000000000000000000006044820152606401610d1a565b61175986868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061371192505050565b6117f9888888888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a91829185019084908082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250611f2e92505050565b611803600160fb55565b5050505050505050565b611815612919565b8051610dcc9061012d906020840190614db5565b606060668054610bd890615584565b611840612919565b61013593909355610136919091556101375561013855565b81611862816129d7565b610c9683836137f7565b611874613270565b61187d33611173565b156118ca5760405162461bcd60e51b815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f7765640000000000000000000000006044820152606401610d1a565b3332146119195760405162461bcd60e51b815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f7765640000000000006044820152606401610d1a565b600061196283838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061195b9250612d8e915050565b60016132c3565b9050806119b15760405162461bcd60e51b815260206004820152600e60248201527f4572726f7220436c61696d696e670000000000000000000000000000000000006044820152606401610d1a565b60006119fa8484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506119f39250612d8e915050565b6000613802565b905080610cc05760405162461bcd60e51b815260206004820152600f60248201527f4572726f7220556e7374616b696e6700000000000000000000000000000000006044820152606401610d1a565b836001600160a01b0381163314611a6357611a63336129d7565b611a6f85858585613b51565b5050505050565b611a7e612919565b610139805460ff1916911515919091179055565b611a9a612919565b6001600160a01b03811615610bc65761013380546001600160a01b0383166001600160a01b031990911617905550565b6000818152606760205260409020546060906001600160a01b0316611b315760405162461bcd60e51b815260206004820152600f60248201527f496e76616c696420746f6b656e496400000000000000000000000000000000006044820152606401610d1a565b61012d611b3d83613bd9565b604051602001611b4e929190615690565b6040516020818303038152906040529050919050565b611b6c612919565b611bab82828080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250600191506138029050565b610dcc5760405162461bcd60e51b815260206004820152600f60248201527f4572726f7220556e7374616b696e6700000000000000000000000000000000006044820152606401610d1a565b60606001600160a01b038216611c4f5760405162461bcd60e51b815260206004820152600c60248201527f7a65726f206164647265737300000000000000000000000000000000000000006044820152606401610d1a565b6000611c5a83611337565b90506000808267ffffffffffffffff811115611c7857611c786150b0565b604051908082528060200260200182016040528015611cfa57816020015b611ce760405180610100016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081611c965790505b50905060005b61012e548111158015611d1257508383105b15611deb57600081815261013460205260409020546001600160a01b03808816911603611ddb576000818152610134602090815260409182902082516101008101845281546001600160a01b031681526001820154928101929092526002810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c082015260079091015460e08201528251839085908110611dc157611dc161562d565b60200260200101819052508280611dd790615643565b9350505b611de481615643565b9050611d00565b50818303611dfb57949350505050565b60008267ffffffffffffffff811115611e1657611e166150b0565b604051908082528060200260200182016040528015611e9857816020015b611e8560405180610100016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081611e345790505b50905060005b83811015611f2457866001600160a01b0316838281518110611ec257611ec261562d565b6020026020010151600001516001600160a01b031603611f1457828181518110611eee57611eee61562d565b6020026020010151828281518110611f0857611f0861562d565b60200260200101819052505b611f1d81615643565b9050611e9e565b5095945050505050565b611f36613270565b611f3f33611173565b15611f8c5760405162461bcd60e51b815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f7765640000000000000000000000006044820152606401610d1a565b333214611fdb5760405162461bcd60e51b815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f7765640000000000006044820152606401610d1a565b61013154421061202d5760405162461bcd60e51b815260206004820152601660248201527f5374616b696e6720706572696f642065787069726564000000000000000000006044820152606401610d1a565b60006120ab338686868660405160200161204b959493929190615795565b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b90508460010361210d576101395460ff166121085760405162461bcd60e51b815260206004820152601060248201527f5374616b696e672064697361626c6564000000000000000000000000000000006044820152606401610d1a565b6121ce565b8460020361216d5761013954610100900460ff166121085760405162461bcd60e51b815260206004820152601060248201527f5374616b696e672064697361626c6564000000000000000000000000000000006044820152606401610d1a565b846003036121ce576101395462010000900460ff166121ce5760405162461bcd60e51b815260206004820152601060248201527f5374616b696e672064697361626c6564000000000000000000000000000000006044820152606401610d1a565b610132546001600160a01b03166121e58288613c79565b6001600160a01b03161461223b5760405162461bcd60e51b815260206004820152600e60248201527f496e76616c6964204163636573730000000000000000000000000000000000006044820152606401610d1a565b60005b84518110156125795760006001600160a01b031661013460008784815181106122695761226961562d565b6020908102919091018101518252810191909152604001600020546001600160a01b0316146122da5760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20494420616c7265616479207374616b65640000000000000000006044820152606401610d1a565b336001600160a01b03166123068683815181106122f9576122f961562d565b6020026020010151611101565b6001600160a01b03161461235c5760405162461bcd60e51b815260206004820152601460248201527f546f6b656e206f776e6572206d69736d617463680000000000000000000000006044820152606401610d1a565b600762093a80600188900361238657610136805490600061237c83615643565b91905055506123d2565b876002036123a95750506101378054602d91623b53809190600061237c83615643565b876003036123d25750506101388054605a916276a700919060006123cc83615643565b91905055505b60006123de8242615615565b9050610131548111156123f15750610131545b6040518061010001604052806124043390565b6001600160a01b031681526020018986815181106124245761242461562d565b602002602001015181526020018a81526020018886815181106124495761244961562d565b602002602001015181526020018786815181106124685761246861562d565b60200260200101518152602001428152602001828152602001600081525061013460008a878151811061249d5761249d61562d565b6020908102919091018101518252818101929092526040908101600020835181546001600160a01b0319166001600160a01b039091161781559183015160018301558201516002820155606082015160038201556080820151600482015560a0820151600582015560c0820151600682015560e090910151600790910155875188908590811061252f5761252f61562d565b60200260200101517f227a473b70d2f893cc7659219575c030a63b5743024fe1e0c1a680e708b1525a60405160405180910390a2505050808061257190615643565b91505061223e565b508351610135600082825461258e9190615615565b9091555050505050505050565b606081158015906125af575061012e548211155b6125fb5760405162461bcd60e51b815260206004820152601160248201527f546f6b656e20496473206e6f74207365740000000000000000000000000000006044820152606401610d1a565b60008267ffffffffffffffff811115612616576126166150b0565b60405190808252806020026020018201604052801561263f578160200160208202803683370190505b50905060005b838110156126c4576000610134818787858181106126655761266561562d565b60209081029290920135835250810191909152604001600020546001600160a01b0316146126b25760018282815181106126a1576126a161562d565b911515602092830291909101909101525b806126bc81615643565b915050612645565b509392505050565b6126d4612919565b610139805491151562010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff909216919091179055565b612715612919565b61013980549115156101000261ff0019909216919091179055565b612738612919565b6001600160a01b0381166127b45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d1a565b610bc681613616565b6127c5612919565b61013155565b6127d36136b8565b6127db613270565b6127e433611173565b156128315760405162461bcd60e51b815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f7765640000000000000000000000006044820152606401610d1a565b3332146128805760405162461bcd60e51b815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f7765640000000000006044820152606401610d1a565b61012f548111156128d35760405162461bcd60e51b815260206004820152601660248201527f4265796f6e64206d617820636c61696d206c696d6974000000000000000000006044820152606401610d1a565b61290f82828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061371192505050565b610dcc600160fb55565b6097546001600160a01b03163314610de05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d1a565b6000818152606760205260409020546001600160a01b0316610bc65760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610d1a565b6daaeb6d7670e522a718067333cd4e3b15610bc6576040517fc61711340000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015612a5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a8191906157e4565b610bc6576040517fede71dcc0000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602401610d1a565b6000612acd82611101565b9050806001600160a01b0316836001600160a01b031603612b565760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610d1a565b336001600160a01b0382161480612b725750612b728133610a47565b612be45760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610d1a565b610c968383613c95565b612bf83382613d03565b612c6a5760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608401610d1a565b610c96838383613d82565b80471015612cc55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610d1a565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612d12576040519150601f19603f3d011682016040523d82523d6000602084013e612d17565b606091505b5050905080610c965760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610d1a565b3390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610c96908490613fb8565b612e1a61409d565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610c9683838360405180602001604052806000815250611a49565b600054610100900460ff16612eea5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b610dcc82826140ef565b600054610100900460ff16612f5f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b610de0614181565b600054610100900460ff16612fd25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b610de06141f5565b600054610100900460ff166130455760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b610de061426c565b600054610100900460ff166130b85760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b610de0733cc6cdda760b79bafa08df41ecfa224f810dceb660016142d7565b6001600160a01b03821661312d5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610d1a565b6000818152606760205260409020546001600160a01b0316156131925760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610d1a565b6131a0600083836001614526565b6000818152606760205260409020546001600160a01b0316156132055760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610d1a565b6001600160a01b038216600081815260686020908152604080832080546001019055848352606790915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60c95460ff1615610de05760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610d1a565b6000808451116133155760405162461bcd60e51b815260206004820152601160248201527f546f6b656e20496473206e6f74207365740000000000000000000000000000006044820152606401610d1a565b6000805b8551811015613528576000610134600088848151811061333b5761333b61562d565b602090810291909101810151825281810192909252604090810160002081516101008101835281546001600160a01b039081168083526001840154958301959095526002830154938201939093526003820154606082015260048201546080820152600582015460a0820152600682015460c082015260079091015460e0820152925087161461340d5760405162461bcd60e51b815260206004820152601460248201527f496e76616c696420546f6b656e204163636573730000000000000000000000006044820152606401610d1a565b61342f8783815181106134225761342261562d565b60200260200101516113e3565b6134399084615615565b92508461351557806040015160010361347457600061345b4262093a80615615565b90506101315481111561346e5750610131545b60c08201525b428160e00181815250508061013460008985815181106134965761349661562d565b6020908102919091018101518252818101929092526040908101600020835181546001600160a01b0319166001600160a01b039091161781559183015160018301558201516002820155606082015160038201556080820151600482015560a0820151600582015560c0820151600682015560e0909101516007909101555b508061352081615643565b915050613319565b50610133546000906001600160a01b031663a9059cbb8661354c85620151806145f5565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015613597573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135bb91906157e4565b90508061360a5760405162461bcd60e51b815260206004820152601960248201527f556e61626c6520746f207472616e7366657220746f6b656e73000000000000006044820152606401610d1a565b50600195945050505050565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600061367482846155d4565b9392505050565b613683613270565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612e473390565b600260fb540361370a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d1a565b600260fb55565b60005b8151811015610dcc57610130546001600160a01b03166323b872dd33308585815181106137435761374361562d565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561379d57600080fd5b505af11580156137b1573d6000803e3d6000fd5b505050506137de6137bf3390565b8383815181106137d1576137d161562d565b60200260200101516130d7565b806137e881615643565b915050613714565b600160fb55565b610dcc338383614601565b6000808451116138545760405162461bcd60e51b815260206004820152601160248201527f546f6b656e20496473206e6f74207365740000000000000000000000000000006044820152606401610d1a565b60005b8451811015613b4657600061013460008784815181106138795761387961562d565b602090810291909101810151825281810192909252604090810160002081516101008101835281546001600160a01b03168082526001830154948201949094526002820154928101929092526003810154606083015260048101546080830152600581015460a0830152600681015460c08301526007015460e082015291506139445760405162461bcd60e51b815260206004820152601060248201527f546f6b656e206e6f74207374616b6564000000000000000000000000000000006044820152606401610d1a565b83613a0257846001600160a01b031681600001516001600160a01b0316146139ae5760405162461bcd60e51b815260206004820152601460248201527f496e76616c696420546f6b656e204163636573730000000000000000000000006044820152606401610d1a565b428160c001511115613a025760405162461bcd60e51b815260206004820181905260248201527f556e61626c6520746f20756e7374616b652061206c6f636b656420746f6b656e6044820152606401610d1a565b8060400151600103613a29576101368054906000613a1f83615801565b9190505550613a69565b8060400151600203613a46576101378054906000613a1f83615801565b8060400151600303613a69576101388054906000613a6383615801565b91905055505b6101358054906000613a7a83615801565b91905055506101346000878481518110613a9657613a9661562d565b6020908102919091018101518252818101929092526040908101600090812080546001600160a01b0319168155600181018290556002810182905560038101829055600481018290556005810182905560068101829055600701558282015160a084015182519081524293810193909352917f529f395783b74aeb16a02d6320297d8415f7312f2ff2c398cd0d70e30bebc6c9910160405180910390a25080613b3e81615643565b915050613857565b506001949350505050565b613b5b3383613d03565b613bcd5760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608401610d1a565b610cc0848484846146cf565b60606000613be683614758565b600101905060008167ffffffffffffffff811115613c0657613c066150b0565b6040519080825280601f01601f191660200182016040528015613c30576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084613c3a57509392505050565b6000806000613c88858561483a565b915091506126c48161487f565b600081815260696020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613cca82611101565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080613d0f83611101565b9050806001600160a01b0316846001600160a01b03161480613d5657506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b80613d7a5750836001600160a01b0316613d6f84610c5b565b6001600160a01b0316145b949350505050565b826001600160a01b0316613d9582611101565b6001600160a01b031614613e115760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610d1a565b6001600160a01b038216613e8c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610d1a565b613e998383836001614526565b826001600160a01b0316613eac82611101565b6001600160a01b031614613f285760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610d1a565b600081815260696020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260688552838620805460001901905590871680865283862080546001019055868652606790945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600061400d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166149e49092919063ffffffff16565b805190915015610c96578080602001905181019061402b91906157e4565b610c965760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d1a565b60c95460ff16610de05760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610d1a565b600054610100900460ff1661415a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b815161416d906065906020850190614db5565b508051610c96906066906020840190614db5565b600054610100900460ff166141ec5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b610de033613616565b600054610100900460ff166142605760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b60c9805460ff19169055565b600054610100900460ff166137f05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b600054610100900460ff166143425760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610d1a565b6daaeb6d7670e522a718067333cd4e3b15610dcc576040517fc3c5a5470000000000000000000000000000000000000000000000000000000081523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af11580156143bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143df91906157e4565b610dcc578015614474576040517f7d3e3dbe0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b15801561445857600080fd5b505af115801561446c573d6000803e3d6000fd5b505050505050565b6001600160a01b038216156144dc576040517fa0af29030000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440161443e565b6040517f4420e4860000000000000000000000000000000000000000000000000000000081523060048201526daaeb6d7670e522a718067333cd4e90634420e4869060240161443e565b6001600160a01b03841615610cc0576000828152610134602090815260409182902082516101008101845281546001600160a01b03168082526001830154938201939093526002820154938101939093526003810154606084015260048101546080840152600581015460a0840152600681015460c08401526007015460e083015215611a6f5760405162461bcd60e51b815260206004820152600c60248201527f546f6b656e207374616b656400000000000000000000000000000000000000006044820152606401610d1a565b600061367482846155f3565b816001600160a01b0316836001600160a01b0316036146625760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610d1a565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6146da848484613d82565b6146e6848484846149f3565b610cc05760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610d1a565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106147a1577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106147cd576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106147eb57662386f26fc10000830492506010015b6305f5e1008310614803576305f5e100830492506008015b612710831061481757612710830492506004015b60648310614829576064830492506002015b600a8310610b8c5760010192915050565b60008082516041036148705760208301516040840151606085015160001a61486487828585614b71565b94509450505050614878565b506000905060025b9250929050565b600081600481111561489357614893615818565b0361489b5750565b60018160048111156148af576148af615818565b036148fc5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610d1a565b600281600481111561491057614910615818565b0361495d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610d1a565b600381600481111561497157614971615818565b03610bc65760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610d1a565b6060613d7a8484600085614c35565b60006001600160a01b0384163b15613b46576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a0290614a5090339089908890889060040161582e565b6020604051808303816000875af1925050508015614a8b575060408051601f3d908101601f19168201909252614a889181019061586a565b60015b614b3e573d808015614ab9576040519150601f19603f3d011682016040523d82523d6000602084013e614abe565b606091505b508051600003614b365760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610d1a565b805181602001fd5b6001600160e01b0319167f150b7a0200000000000000000000000000000000000000000000000000000000149050613d7a565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614ba85750600090506003614c2c565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614bfc573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614c2557600060019250925050614c2c565b9150600090505b94509492505050565b606082471015614cad5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d1a565b600080866001600160a01b03168587604051614cc99190615887565b60006040518083038185875af1925050503d8060008114614d06576040519150601f19603f3d011682016040523d82523d6000602084013e614d0b565b606091505b50915091506115fa8783838760608315614d86578251600003614d7f576001600160a01b0385163b614d7f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d1a565b5081613d7a565b613d7a8383815115614d9b5781518083602001fd5b8060405162461bcd60e51b8152600401610d1a9190614f10565b828054614dc190615584565b90600052602060002090601f016020900481019282614de35760008555614e29565b82601f10614dfc57805160ff1916838001178555614e29565b82800160010185558215614e29579182015b82811115614e29578251825591602001919060010190614e0e565b50614e35929150614e39565b5090565b5b80821115614e355760008155600101614e3a565b6001600160e01b031981168114610bc657600080fd5b600060208284031215614e7657600080fd5b813561367481614e4e565b80356001600160a01b0381168114614e9857600080fd5b919050565b600060208284031215614eaf57600080fd5b61367482614e81565b60005b83811015614ed3578181015183820152602001614ebb565b83811115610cc05750506000910152565b60008151808452614efc816020860160208601614eb8565b601f01601f19169290920160200192915050565b6020815260006136746020830184614ee4565b600060208284031215614f3557600080fd5b5035919050565b60008060408385031215614f4f57600080fd5b614f5883614e81565b946020939093013593505050565b600080600060608486031215614f7b57600080fd5b614f8484614e81565b9250614f9260208501614e81565b9150604084013590509250925092565b60008060408385031215614fb557600080fd5b614fbe83614e81565b9150614fcc60208401614e81565b90509250929050565b60008083601f840112614fe757600080fd5b50813567ffffffffffffffff811115614fff57600080fd5b6020830191508360208260051b850101111561487857600080fd5b60008060006040848603121561502f57600080fd5b833567ffffffffffffffff81111561504657600080fd5b61505286828701614fd5565b9094509250615065905060208501614e81565b90509250925092565b6000806020838503121561508157600080fd5b823567ffffffffffffffff81111561509857600080fd5b6150a485828601614fd5565b90969095509350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156150ef576150ef6150b0565b604052919050565b600067ffffffffffffffff831115615111576151116150b0565b6151246020601f19601f860116016150c6565b905082815283838301111561513857600080fd5b828260208301376000602084830101529392505050565b600082601f83011261516057600080fd5b613674838335602085016150f7565b60008060008060008060008060a0898b03121561518b57600080fd5b883567ffffffffffffffff808211156151a357600080fd5b6151af8c838d0161514f565b995060208b0135985060408b01359150808211156151cc57600080fd5b6151d88c838d01614fd5565b909850965060608b01359150808211156151f157600080fd5b6151fd8c838d01614fd5565b909650945060808b013591508082111561521657600080fd5b506152238b828c01614fd5565b999c989b5096995094979396929594505050565b60006020828403121561524957600080fd5b813567ffffffffffffffff81111561526057600080fd5b8201601f8101841361527157600080fd5b613d7a848235602084016150f7565b6000806000806080858703121561529657600080fd5b5050823594602084013594506040840135936060013592509050565b8015158114610bc657600080fd5b600080604083850312156152d357600080fd5b6152dc83614e81565b915060208301356152ec816152b2565b809150509250929050565b6000806000806080858703121561530d57600080fd5b61531685614e81565b935061532460208601614e81565b925060408501359150606085013567ffffffffffffffff81111561534757600080fd5b6153538782880161514f565b91505092959194509250565b60006020828403121561537157600080fd5b8135613674816152b2565b602080825282518282018190526000919060409081850190868401855b8281101561540557815180516001600160a01b0316855286810151878601528581015186860152606080820151908601526080808201519086015260a0808201519086015260c0808201519086015260e090810151908501526101009093019290850190600101615399565b5091979650505050505050565b600082601f83011261542357600080fd5b8135602067ffffffffffffffff82111561543f5761543f6150b0565b8160051b61544e8282016150c6565b928352848101820192828101908785111561546857600080fd5b83870192505b848310156115fa5782358252918301919083019061546e565b600080600080600060a0868803121561549f57600080fd5b853567ffffffffffffffff808211156154b757600080fd5b6154c389838a0161514f565b96506020880135955060408801359150808211156154e057600080fd5b6154ec89838a01615412565b9450606088013591508082111561550257600080fd5b61550e89838a01615412565b9350608088013591508082111561552457600080fd5b5061553188828901615412565b9150509295509295909350565b6020808252825182820181905260009190848201906040850190845b8181101561557857835115158352928401929184019160010161555a565b50909695505050505050565b600181811c9082168061559857607f821691505b6020821081036155b857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156155ee576155ee6155be565b500290565b60008261561057634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115615628576156286155be565b500190565b634e487b7160e01b600052603260045260246000fd5b60006000198203615656576156566155be565b5060010190565b60008282101561566f5761566f6155be565b500390565b60008151615686818560208601614eb8565b9290920192915050565b600080845481600182811c9150808316806156ac57607f831692505b602080841082036156cb57634e487b7160e01b86526022600452602486fd5b8180156156df57600181146156f05761571d565b60ff1986168952848901965061571d565b60008b81526020902060005b868110156157155781548b8201529085019083016156fc565b505084890196505b5050505050506157596157308286615674565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050190565b95945050505050565b60008151602080840160005b8381101561578a5781518752958201959082019060010161576e565b509495945050505050565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008660601b16815284601482015260006115fa6157de6157d86034850188615762565b86615762565b84615762565b6000602082840312156157f657600080fd5b8151613674816152b2565b600081615810576158106155be565b506000190190565b634e487b7160e01b600052602160045260246000fd5b60006001600160a01b038087168352808616602084015250836040830152608060608301526158606080830184614ee4565b9695505050505050565b60006020828403121561587c57600080fd5b815161367481614e4e565b60008251615899818460208701614eb8565b919091019291505056fe697066733a2f2f516d624576516373557a4c646f73574a704e58654357784d5967666435393550394252445745717a4155755651752fa26469706673582212204e796e261f44d1e682e205b6b89fb7142232475660f35f8e1f7d30af1fdf34f764736f6c634300080d0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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