ETH Price: $1,978.37 (+3.83%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw200728952024-06-12 2:54:35627 days ago1718160875IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.004422536.53469829
Withdraw188612852023-12-25 7:31:23797 days ago1703489483IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0103308617.74489152
Claim Reward184588782023-10-29 22:41:35853 days ago1698619295IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0071765511.35680228
Withdraw174847772023-06-15 10:45:35990 days ago1686825935IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0095141816.81385622
Claim Reward174847722023-06-15 10:44:35990 days ago1686825875IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0104113417.1499855
Claim Reward174810412023-06-14 22:07:35990 days ago1686780455IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.040586574.72995039
Claim Reward174628452023-06-12 8:38:47993 days ago1686559127IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0076365514.94930855
Claim Reward174599892023-06-11 23:00:47993 days ago1686524447IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0067077214.09499399
Claim Reward171244572023-04-25 16:26:591040 days ago1682440019IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0193681139.20862266
Claim Reward170195292023-04-10 18:23:111055 days ago1681150991IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0178410228.47466058
Claim Reward169733232023-04-04 4:55:591062 days ago1680584159IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.009600719.7928946
Claim Reward169459922023-03-31 8:27:111066 days ago1680251231IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0128671524.2208964
Claim Reward169116392023-03-26 12:35:591071 days ago1679834159IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.007771216.1901526
Claim Reward169083882023-03-26 1:39:111071 days ago1679794751IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0080559414.44286278
Claim Reward168898462023-03-23 11:08:351074 days ago1679569715IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0074995815.18864136
Deposit168897642023-03-23 10:51:591074 days ago1679568719IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0036599614.33639592
Deposit168647132023-03-19 22:25:471077 days ago1679264747IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0127476816.94143392
Withdraw168646402023-03-19 22:11:111077 days ago1679263871IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0146308519.188213
Claim Reward168550522023-03-18 13:51:351078 days ago1679147495IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0088773318.65440019
Claim Reward168121402023-03-12 13:07:591085 days ago1678626479IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0118253718.73943669
Claim Reward168085312023-03-12 0:56:111085 days ago1678582571IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0092248320.16067326
Claim Reward168000262023-03-10 20:13:591086 days ago1678479239IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0240933847.47334035
Deposit167844602023-03-08 15:34:471088 days ago1678289687IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0194260833.73655588
Deposit167791772023-03-07 21:45:471089 days ago1678225547IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0224124936.60270151
Deposit167648852023-03-05 21:32:231091 days ago1678051943IN
0x7A6CF0f9...ffc94F914
0.00089 ETH0.0190489231.11090907
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer200728952024-06-12 2:54:35627 days ago1718160875
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer188612852023-12-25 7:31:23797 days ago1703489483
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer184588782023-10-29 22:41:35853 days ago1698619295
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer174847772023-06-15 10:45:35990 days ago1686825935
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer174847722023-06-15 10:44:35990 days ago1686825875
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer174810412023-06-14 22:07:35990 days ago1686780455
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer174628452023-06-12 8:38:47993 days ago1686559127
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer174599892023-06-11 23:00:47993 days ago1686524447
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer171244572023-04-25 16:26:591040 days ago1682440019
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer170195292023-04-10 18:23:111055 days ago1681150991
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer169733232023-04-04 4:55:591062 days ago1680584159
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer169459922023-03-31 8:27:111066 days ago1680251231
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer169116392023-03-26 12:35:591071 days ago1679834159
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer169083882023-03-26 1:39:111071 days ago1679794751
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer168898462023-03-23 11:08:351074 days ago1679569715
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer168897642023-03-23 10:51:591074 days ago1679568719
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer168647132023-03-19 22:25:471077 days ago1679264747
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer168646402023-03-19 22:11:111077 days ago1679263871
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer168550522023-03-18 13:51:351078 days ago1679147495
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer168121402023-03-12 13:07:591085 days ago1678626479
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer168085312023-03-12 0:56:111085 days ago1678582571
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer168000262023-03-10 20:13:591086 days ago1678479239
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer167844602023-03-08 15:34:471088 days ago1678289687
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer167791772023-03-07 21:45:471089 days ago1678225547
0x7A6CF0f9...ffc94F914
0.00089 ETH
Transfer167648852023-03-05 21:32:231091 days ago1678051943
0x7A6CF0f9...ffc94F914
0.00089 ETH
View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

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

Contract Source Code Verified (Exact Match)

Contract Name:
WPTNftStaking

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @author Brewlabs
 * This contract has been developed by brewlabs.info
 */
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

contract WPTNftStaking is Ownable, IERC721Receiver, ReentrancyGuard {
    using SafeERC20 for IERC20;

    bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
    uint256 private constant BLOCKS_PER_DAY = 6426;
    uint256 private PRECISION_FACTOR;

    // Whether it is initialized
    bool public isInitialized;
    uint256 public duration = 365; // 365 days

    // The block number when staking starts.
    uint256 public startBlock;
    // The block number when staking ends.
    uint256 public bonusEndBlock;
    // tokens created per block.
    uint256 public rewardPerBlock;
    // The block number of the last pool update
    uint256 public lastRewardBlock;

    address public treasury = 0x64961Ffd0d84b2355eC2B5d35B0d8D8825A774dc;
    uint256 public performanceFee = 0.00089 ether;

    // The staked token
    IERC721 public stakingNft;
    // The earned token
    IERC20 public earnedToken;
    // Accrued token per share
    uint256 public accTokenPerShare;
    uint256 public oneTimeLimit = 40;

    uint256 public totalStaked;
    uint256 private totalEarned;
    uint256 private paidRewards;
    uint256 private shouldTotalPaid;

    struct UserInfo {
        uint256 amount; // number of staked NFTs
        uint256[] tokenIds; // staked tokenIds
        uint256 rewardDebt; // Reward debt
    }
    // Info of each user that stakes tokenIds

    mapping(address => UserInfo) public userInfo;

    event Deposit(address indexed user, uint256[] tokenIds);
    event Withdraw(address indexed user, uint256[] tokenIds);
    event Claim(address indexed user, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256[] tokenIds);
    event AdminTokenRecovered(address tokenRecovered, uint256 amount);

    event NewStartAndEndBlocks(uint256 startBlock, uint256 endBlock);
    event NewRewardPerBlock(uint256 rewardPerBlock);
    event RewardsStop(uint256 blockNumber);
    event EndBlockUpdated(uint256 blockNumber);

    event ServiceInfoUpadted(address _addr, uint256 _fee);
    event DurationUpdated(uint256 _duration);

    constructor() {}

    /*
    * @notice Initialize the contract
    * @param _stakingNft: nft address to stake
    * @param _earnedToken: earned token address
    * @param _rewardPerBlock: reward per block (in earnedToken)
    */
    function initialize(IERC721 _stakingNft, IERC20 _earnedToken, uint256 _rewardPerBlock) external onlyOwner {
        require(!isInitialized, "Already initialized");

        // Make this contract initialized
        isInitialized = true;

        stakingNft = _stakingNft;
        earnedToken = _earnedToken;
        rewardPerBlock = _rewardPerBlock;

        uint256 decimalsRewardToken = uint256(IERC20Metadata(address(earnedToken)).decimals());
        require(decimalsRewardToken < 30, "Must be inferior to 30");
        PRECISION_FACTOR = uint256(10 ** (40 - decimalsRewardToken));
    }

    /*
    * @notice Deposit staked tokens and collect reward tokens (if any)
    * @param _amount: amount to withdraw (in earnedToken)
    */
    function deposit(uint256[] memory _tokenIds) external payable nonReentrant {
        require(startBlock > 0 && startBlock < block.number, "Staking hasn't started yet");
        require(_tokenIds.length > 0, "must add at least one tokenId");
        require(_tokenIds.length <= oneTimeLimit, "cannot exceed one-time limit");

        _transferPerformanceFee();
        _updatePool();

        UserInfo storage user = userInfo[msg.sender];
        if (user.amount > 0) {
            uint256 pending = (user.amount * accTokenPerShare) / PRECISION_FACTOR - user.rewardDebt;
            if (pending > 0) {
                require(availableRewardTokens() >= pending, "Insufficient reward tokens");
                earnedToken.safeTransfer(address(msg.sender), pending);
                paidRewards += pending;
                emit Claim(msg.sender, pending);
            }
        }

        for (uint256 i = 0; i < _tokenIds.length; i++) {
            uint256 tokenId = _tokenIds[i];
            stakingNft.safeTransferFrom(msg.sender, address(this), tokenId);
            user.tokenIds.push(tokenId);
        }
        user.amount = user.amount + _tokenIds.length;
        user.rewardDebt = (user.amount * accTokenPerShare) / PRECISION_FACTOR;

        totalStaked = totalStaked + _tokenIds.length;
        emit Deposit(msg.sender, _tokenIds);
    }

    /*
    * @notice Withdraw staked tokenIds and collect reward tokens
    * @param _amount: number of tokenIds to unstake
    */
    function withdraw(uint256 _amount) external payable nonReentrant {
        require(_amount > 0, "Amount should be greator than 0");
        require(_amount <= oneTimeLimit, "cannot exceed one-time limit");

        UserInfo storage user = userInfo[msg.sender];
        require(user.amount >= _amount, "Amount to withdraw too high");

        _transferPerformanceFee();
        _updatePool();

        if (user.amount > 0) {
            uint256 pending = (user.amount * accTokenPerShare) / PRECISION_FACTOR - user.rewardDebt;
            if (pending > 0) {
                require(availableRewardTokens() >= pending, "Insufficient reward tokens");
                earnedToken.safeTransfer(address(msg.sender), pending);
                paidRewards += pending;
                emit Claim(msg.sender, pending);
            }
        }

        uint256[] memory _tokenIds = new uint256[](_amount);
        for (uint256 i = 0; i < _amount; i++) {
            uint256 tokenId = user.tokenIds[user.tokenIds.length - 1];
            user.tokenIds.pop();

            _tokenIds[i] = tokenId;
            stakingNft.safeTransferFrom(address(this), msg.sender, tokenId);
        }
        user.amount = user.amount - _amount;
        user.rewardDebt = (user.amount * accTokenPerShare) / PRECISION_FACTOR;

        totalStaked = totalStaked - _amount;
        emit Withdraw(msg.sender, _tokenIds);
    }

    function claimReward() external payable nonReentrant {
        UserInfo storage user = userInfo[msg.sender];

        _transferPerformanceFee();
        _updatePool();

        if (user.amount == 0) return;

        uint256 pending = (user.amount * accTokenPerShare) / PRECISION_FACTOR - user.rewardDebt;
        if (pending > 0) {
            require(availableRewardTokens() >= pending, "Insufficient reward tokens");
            earnedToken.safeTransfer(address(msg.sender), pending);
            paidRewards += pending;
        }

        user.rewardDebt = (user.amount * accTokenPerShare) / PRECISION_FACTOR;
        emit Claim(msg.sender, pending);
    }

    /*
    * @notice Withdraw staked NFTs without caring about rewards
    * @dev Needs to be for emergency.
    */
    function emergencyWithdraw() external nonReentrant {
        UserInfo storage user = userInfo[msg.sender];
        uint256 _amount = user.amount;
        if (_amount > oneTimeLimit) _amount = oneTimeLimit;

        uint256[] memory _tokenIds = new uint256[](_amount);
        for (uint256 i = 0; i < _amount; i++) {
            uint256 tokenId = user.tokenIds[user.tokenIds.length - 1];
            user.tokenIds.pop();

            _tokenIds[i] = tokenId;
            stakingNft.safeTransferFrom(address(this), msg.sender, tokenId);
        }
        user.amount = user.amount - _amount;
        user.rewardDebt = (user.amount * accTokenPerShare) / PRECISION_FACTOR;
        totalStaked = totalStaked - _amount;

        emit EmergencyWithdraw(msg.sender, _tokenIds);
    }

    function stakedInfo(address _user) external view returns (uint256, uint256[] memory) {
        return (userInfo[_user].amount, userInfo[_user].tokenIds);
    }

    /**
     * @notice Available amount of reward token
     */
    function availableRewardTokens() public view returns (uint256) {
        return earnedToken.balanceOf(address(this));
    }

    function insufficientRewards() external view returns (uint256) {
        uint256 adjustedShouldTotalPaid = shouldTotalPaid;
        uint256 remainRewards = availableRewardTokens() + paidRewards;

        if (startBlock == 0) {
            adjustedShouldTotalPaid += rewardPerBlock * duration * BLOCKS_PER_DAY;
        } else {
            uint256 remainBlocks = _getMultiplier(lastRewardBlock, bonusEndBlock);
            adjustedShouldTotalPaid += rewardPerBlock * remainBlocks;
        }

        if (remainRewards >= adjustedShouldTotalPaid) return 0;
        return adjustedShouldTotalPaid - remainRewards;
    }

    /*
    * @notice View function to see pending reward on frontend.
    * @param _user: user address
    * @return Pending reward for a given user
    */
    function pendingReward(address _user) external view returns (uint256) {
        UserInfo storage user = userInfo[_user];

        uint256 adjustedTokenPerShare = accTokenPerShare;
        if (block.number > lastRewardBlock && totalStaked != 0 && lastRewardBlock > 0) {
            uint256 multiplier = _getMultiplier(lastRewardBlock, block.number);
            uint256 rewards = multiplier * rewardPerBlock;

            adjustedTokenPerShare += (rewards * PRECISION_FACTOR) / totalStaked;
        }

        return (user.amount * adjustedTokenPerShare) / PRECISION_FACTOR - user.rewardDebt;
    }

    /**
     *
     * Admin Methods
     *
     */
    function increaseEmissionRate(uint256 _amount) external onlyOwner {
        require(startBlock > 0, "pool is not started");
        require(bonusEndBlock > block.number, "pool was already finished");
        require(_amount > 0, "invalid amount");

        _updatePool();
        earnedToken.safeTransferFrom(msg.sender, address(this), _amount);

        uint256 remainRewards = availableRewardTokens() + paidRewards;
        if (remainRewards > shouldTotalPaid) {
            remainRewards = remainRewards - shouldTotalPaid;

            uint256 remainBlocks = bonusEndBlock - block.number;
            rewardPerBlock = remainRewards / remainBlocks;
            emit NewRewardPerBlock(rewardPerBlock);
        }
    }

    /*
    * @notice Withdraw reward token
    * @dev Only callable by owner. Needs to be for emergency.
    */
    function emergencyRewardWithdraw(uint256 _amount) external onlyOwner {
        require(block.number > bonusEndBlock, "Pool is running");
        require(availableRewardTokens() >= _amount, "Insufficient reward tokens");

        if (_amount == 0) _amount = availableRewardTokens();
        earnedToken.safeTransfer(address(msg.sender), _amount);
    }

    function startReward() external onlyOwner {
        require(startBlock == 0, "Pool was already started");

        startBlock = block.number + 100;
        bonusEndBlock = startBlock + duration * BLOCKS_PER_DAY;
        lastRewardBlock = startBlock;

        emit NewStartAndEndBlocks(startBlock, bonusEndBlock);
    }

    function stopReward() external onlyOwner {
        _updatePool();

        uint256 remainRewards = availableRewardTokens() + paidRewards;
        if (remainRewards > shouldTotalPaid) {
            remainRewards = remainRewards - shouldTotalPaid;
            earnedToken.transfer(msg.sender, remainRewards);
        }

        bonusEndBlock = block.number;
        emit RewardsStop(bonusEndBlock);
    }

    function updateEndBlock(uint256 _endBlock) external onlyOwner {
        require(startBlock > 0, "Pool is not started");
        require(bonusEndBlock > block.number, "Pool was already finished");
        require(_endBlock > block.number && _endBlock > startBlock, "Invalid end block");

        bonusEndBlock = _endBlock;
        emit EndBlockUpdated(_endBlock);
    }

    /*
    * @notice Update reward per block
    * @dev Only callable by owner.
    * @param _rewardPerBlock: the reward per block
    */
    function updateRewardPerBlock(uint256 _rewardPerBlock) external onlyOwner {
        rewardPerBlock = _rewardPerBlock;
        emit NewRewardPerBlock(_rewardPerBlock);
    }

    function setDuration(uint256 _duration) external onlyOwner {
        require(_duration >= 30, "lower limit reached");

        duration = _duration;
        if (startBlock > 0) {
            bonusEndBlock = startBlock + duration * BLOCKS_PER_DAY;
            require(bonusEndBlock > block.number, "invalid duration");
        }
        emit DurationUpdated(_duration);
    }

    function setServiceInfo(address _treasury, uint256 _fee) external {
        require(msg.sender == treasury, "setServiceInfo: FORBIDDEN");
        require(_treasury != address(0x0), "Invalid address");

        treasury = _treasury;
        performanceFee = _fee;
        emit ServiceInfoUpadted(_treasury, _fee);
    }

    /**
     * @notice It allows the admin to recover wrong tokens sent to the contract
     * @param _token: the address of the token to withdraw
     * @dev This function is only callable by admin.
     */
    function rescueTokens(address _token) external onlyOwner {
        require(_token != address(earnedToken), "Cannot be reward token");

        uint256 amount = address(this).balance;
        if (_token == address(0x0)) {
            payable(msg.sender).transfer(amount);
        } else {
            amount = IERC20(_token).balanceOf(address(this));
            IERC20(_token).safeTransfer(address(msg.sender), amount);
        }

        emit AdminTokenRecovered(_token, amount);
    }

    /**
     *
     * Internal Methods
     *
     */
    /*
    * @notice Update reward variables of the given pool to be up-to-date.
    */
    function _updatePool() internal {
        if (block.number <= lastRewardBlock || lastRewardBlock == 0) return;
        if (totalStaked == 0) {
            lastRewardBlock = block.number;
            return;
        }

        uint256 multiplier = _getMultiplier(lastRewardBlock, block.number);
        uint256 _reward = multiplier * rewardPerBlock;
        accTokenPerShare += (_reward * PRECISION_FACTOR) / totalStaked;
        lastRewardBlock = block.number;

        shouldTotalPaid += _reward;
    }

    /*
    * @notice Return reward multiplier over the given _from to _to block.
    * @param _from: block to start
    * @param _to: block to finish
    */
    function _getMultiplier(uint256 _from, uint256 _to) internal view returns (uint256) {
        if (_to <= bonusEndBlock) {
            return _to - _from;
        } else if (_from >= bonusEndBlock) {
            return 0;
        } else {
            return bonusEndBlock - _from;
        }
    }

    function _transferPerformanceFee() internal {
        require(msg.value >= performanceFee, "should pay small gas to compound or harvest");

        payable(treasury).transfer(performanceFee);
        if (msg.value > performanceFee) {
            payable(msg.sender).transfer(msg.value - performanceFee);
        }
    }

    /**
     * onERC721Received(address operator, address from, uint256 tokenId, bytes data) → bytes4
     * 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.
     */
    function onERC721Received(address, address, uint256, bytes calldata) external view override returns (bytes4) {
        require(msg.sender == address(stakingNft), "not enabled NFT");
        return _ERC721_RECEIVED;
    }

    receive() external payable {}
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev 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);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

// 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 IERC20Permit {
    /**
     * @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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

// 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 IERC20 {
    /**
     * @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);
}

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

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.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 SafeERC20 {
    using Address for address;

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

    function safeTransferFrom(
        IERC20 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(
        IERC20 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(
        IERC20 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(
        IERC20 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(
        IERC20Permit 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(IERC20 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");
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * 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 9 of 12 : IERC721Receiver.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 IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

// 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 Address {
    /**
     * @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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(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);
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenRecovered","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AdminTokenRecovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"DurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"EndBlockUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rewardPerBlock","type":"uint256"}],"name":"NewRewardPerBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endBlock","type":"uint256"}],"name":"NewStartAndEndBlocks","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":"uint256","name":"blockNumber","type":"uint256"}],"name":"RewardsStop","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"ServiceInfoUpadted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"accTokenPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availableRewardTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bonusEndBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimReward","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"duration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"earnedToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"emergencyRewardWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"increaseEmissionRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"_stakingNft","type":"address"},{"internalType":"contract IERC20","name":"_earnedToken","type":"address"},{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"insufficientRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRewardBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oneTimeLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"performanceFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"rescueTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"setDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setServiceInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"stakedInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingNft","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endBlock","type":"uint256"}],"name":"updateEndBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"}],"name":"updateRewardPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405261016d600455600980546001600160a01b0319167364961ffd0d84b2355ec2b5d35b0d8d8825a774dc1790556603297345d9a000600a556028600e5534801561004c57600080fd5b506100563361005f565b600180556100af565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61282a806100be6000396000f3fe6080604052600436106101d15760003560e01c806380dc0672116100f8578063a9f8d18111610090578063a9f8d18114610513578063b493877714610529578063b88a802f14610557578063db2e21bc1461055f578063f2fde38b14610574578063f3aeb31d14610594578063f40f0f52146105a9578063f4ef5ed5146105c9578063f6be71d1146105e957600080fd5b806380dc06721461043d578063817b1cd21461045257806381b619481461046857806387788782146104885780638ae39cac1461049e5780638da5cb5b146104b45780638f662915146104d25780639f94e272146104e8578063a2cd12d2146104fd57600080fd5b80633279beab1161016b5780633279beab14610333578063392e53cd1461035357806348cd4cb11461037d578063598b8e711461039357806361d027b3146103a65780636982d815146103d35780636e707b73146103f3578063715018a614610413578063746c8ae11461042857600080fd5b80626f0231146101dd578062ae3bf8146101ff57806301f8a9761461021f5780630fb5a6b41461023f578063150b7a02146102685780631794bb3c146102a15780631959a002146102c15780631aed65531461030a5780632e1a7d4d1461032057600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b506101fd6101f83660046121e8565b610609565b005b34801561020b57600080fd5b506101fd61021a366004612216565b610737565b34801561022b57600080fd5b506101fd61023a3660046121e8565b610898565b34801561024b57600080fd5b5061025560045481565b6040519081526020015b60405180910390f35b34801561027457600080fd5b5061028861028336600461223a565b6108d5565b6040516001600160e01b0319909116815260200161025f565b3480156102ad57600080fd5b506101fd6102bc3660046122d9565b610936565b3480156102cd57600080fd5b506102f56102dc366004612216565b6013602052600090815260409020805460029091015482565b6040805192835260208301919091520161025f565b34801561031657600080fd5b5061025560065481565b6101fd61032e3660046121e8565b610a96565b34801561033f57600080fd5b506101fd61034e3660046121e8565b610e08565b34801561035f57600080fd5b5060035461036d9060ff1681565b604051901515815260200161025f565b34801561038957600080fd5b5061025560055481565b6101fd6103a1366004612330565b610ea4565b3480156103b257600080fd5b506009546103c6906001600160a01b031681565b60405161025f91906123ee565b3480156103df57600080fd5b50600b546103c6906001600160a01b031681565b3480156103ff57600080fd5b50600c546103c6906001600160a01b031681565b34801561041f57600080fd5b506101fd61119c565b34801561043457600080fd5b506101fd6111b0565b34801561044957600080fd5b506101fd61127b565b34801561045e57600080fd5b50610255600f5481565b34801561047457600080fd5b506101fd610483366004612402565b611369565b34801561049457600080fd5b50610255600a5481565b3480156104aa57600080fd5b5061025560075481565b3480156104c057600080fd5b506000546001600160a01b03166103c6565b3480156104de57600080fd5b50610255600d5481565b3480156104f457600080fd5b50610255611459565b34801561050957600080fd5b50610255600e5481565b34801561051f57600080fd5b5061025560085481565b34801561053557600080fd5b50610549610544366004612216565b6114d0565b60405161025f929190612469565b6101fd61154c565b34801561056b57600080fd5b506101fd611660565b34801561058057600080fd5b506101fd61058f366004612216565b611854565b3480156105a057600080fd5b506102556118ca565b3480156105b557600080fd5b506102556105c4366004612216565b611972565b3480156105d557600080fd5b506101fd6105e43660046121e8565b611a2f565b3480156105f557600080fd5b506101fd6106043660046121e8565b611bb9565b610611611ca8565b60006005541161065e5760405162461bcd60e51b8152602060048201526013602482015272141bdbdb081a5cc81b9bdd081cdd185c9d1959606a1b60448201526064015b60405180910390fd5b43600654116106ab5760405162461bcd60e51b8152602060048201526019602482015278141bdbdb081dd85cc8185b1c9958591e48199a5b9a5cda1959603a1b6044820152606401610655565b43811180156106bb575060055481115b6106fb5760405162461bcd60e51b8152602060048201526011602482015270496e76616c696420656e6420626c6f636b60781b6044820152606401610655565b60068190556040518181527f0972575658363b3e7c472ab3a6a918726742c853b732f6a4a2763e2e3a94c977906020015b60405180910390a150565b61073f611ca8565b600c546001600160a01b03908116908216036107965760405162461bcd60e51b815260206004820152601660248201527521b0b73737ba103132903932bbb0b932103a37b5b2b760511b6044820152606401610655565b476001600160a01b0382166107d857604051339082156108fc029083906000818181858888f193505050501580156107d2573d6000803e3d6000fd5b5061085b565b6040516370a0823160e01b81526001600160a01b038316906370a08231906108049030906004016123ee565b602060405180830381865afa158015610821573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108459190612482565b905061085b6001600160a01b0383163383611d02565b7f74f5dcd55c394cb1c6d3b9da22c2464bcc46c38cc3865bd629ed75823249b40b828260405161088c92919061249b565b60405180910390a15050565b6108a0611ca8565b60078190556040518181527f0c4d677eef92893ac7ec52faf8140fc6c851ab4736302b4f3a89dfb20696a0df9060200161072c565b600b546000906001600160a01b031633146109245760405162461bcd60e51b815260206004820152600f60248201526e1b9bdd08195b98589b195908139195608a1b6044820152606401610655565b50630a85bd0160e11b95945050505050565b61093e611ca8565b60035460ff16156109875760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401610655565b6003805460ff19166001179055600b80546001600160a01b038086166001600160a01b031992831617909255600c8054928516929091168217905560078290556040805163313ce56760e01b815290516000929163313ce5679160048281019260209291908290030181865afa158015610a05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2991906124b4565b60ff169050601e8110610a775760405162461bcd60e51b815260206004820152601660248201527504d75737420626520696e666572696f7220746f2033360541b6044820152606401610655565b610a828160286124ed565b610a8d90600a6125e8565b60025550505050565b610a9e611d5d565b60008111610aee5760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e742073686f756c642062652067726561746f72207468616e2030006044820152606401610655565b600e54811115610b105760405162461bcd60e51b8152600401610655906125f4565b3360009081526013602052604090208054821115610b705760405162461bcd60e51b815260206004820152601b60248201527f416d6f756e7420746f20776974686472617720746f6f206869676800000000006044820152606401610655565b610b78611db6565b610b80611e9e565b805415610c3a5760008160020154600254600d548460000154610ba3919061262b565b610bad919061264a565b610bb791906124ed565b90508015610c385780610bc8611459565b1015610be65760405162461bcd60e51b81526004016106559061266c565b600c54610bfd906001600160a01b03163383611d02565b8060116000828254610c0f91906126a3565b909155505060405181815233906000805160206127d58339815191529060200160405180910390a25b505b60008267ffffffffffffffff811115610c5557610c5561231a565b604051908082528060200260200182016040528015610c7e578160200160208202803683370190505b50905060005b83811015610d7d5760018084018054600092610c9f916124ed565b81548110610caf57610caf6126bb565b9060005260206000200154905083600101805480610ccf57610ccf6126d1565b6001900381819060005260206000200160009055905580838381518110610cf857610cf86126bb565b6020908102919091010152600b54604051632142170760e11b81526001600160a01b03909116906342842e0e90610d37903090339086906004016126e7565b600060405180830381600087803b158015610d5157600080fd5b505af1158015610d65573d6000803e3d6000fd5b50505050508080610d759061270b565b915050610c84565b508154610d8b9084906124ed565b808355600254600d549091610da0919061262b565b610daa919061264a565b6002830155600f54610dbd9084906124ed565b600f5560405133907f67e9df8b3c7743c9f1b625ba4f2b4e601206dbd46ed5c33c85a1242e4d23a2d190610df2908490612724565b60405180910390a25050610e0560018055565b50565b610e10611ca8565b6006544311610e535760405162461bcd60e51b815260206004820152600f60248201526e506f6f6c2069732072756e6e696e6760881b6044820152606401610655565b80610e5c611459565b1015610e7a5760405162461bcd60e51b81526004016106559061266c565b80600003610e8d57610e8a611459565b90505b600c54610e05906001600160a01b03163383611d02565b610eac611d5d565b6000600554118015610ebf575043600554105b610f0b5760405162461bcd60e51b815260206004820152601a60248201527f5374616b696e67206861736e27742073746172746564207965740000000000006044820152606401610655565b6000815111610f5c5760405162461bcd60e51b815260206004820152601d60248201527f6d75737420616464206174206c65617374206f6e6520746f6b656e49640000006044820152606401610655565b600e5481511115610f7f5760405162461bcd60e51b8152600401610655906125f4565b610f87611db6565b610f8f611e9e565b3360009081526013602052604090208054156110585760008160020154600254600d548460000154610fc1919061262b565b610fcb919061264a565b610fd591906124ed565b905080156110565780610fe6611459565b10156110045760405162461bcd60e51b81526004016106559061266c565b600c5461101b906001600160a01b03163383611d02565b806011600082825461102d91906126a3565b909155505060405181815233906000805160206127d58339815191529060200160405180910390a25b505b60005b8251811015611113576000838281518110611078576110786126bb565b6020908102919091010151600b54604051632142170760e11b81529192506001600160a01b0316906342842e0e906110b8903390309086906004016126e7565b600060405180830381600087803b1580156110d257600080fd5b505af11580156110e6573d6000803e3d6000fd5b5050505060018381018054918201815560009081526020902001558061110b8161270b565b91505061105b565b508151815461112291906126a3565b808255600254600d549091611137919061262b565b611141919061264a565b60028201558151600f5461115591906126a3565b600f5560405133907fff409334d2645d660e7cfa41a637aa21f45a79ecb9660a6931aa923bf75577c79061118a908590612724565b60405180910390a250610e0560018055565b6111a4611ca8565b6111ae6000611f3b565b565b6111b8611ca8565b600554156112035760405162461bcd60e51b8152602060048201526018602482015277141bdbdb081dd85cc8185b1c9958591e481cdd185c9d195960421b6044820152606401610655565b61120e4360646126a3565b6005556004546112219061191a9061262b565b60055461122e91906126a3565b600681905560055460088190556040517f7cd0ab87d19036f3dfadadb232c78aa4879dda3f0c994a9d637532410ee2ce0692611271928252602082015260400190565b60405180910390a1565b611283611ca8565b61128b611e9e565b6000601154611298611459565b6112a291906126a3565b9050601254811115611333576012546112bb90826124ed565b600c5460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb906112ee903390859060040161249b565b6020604051808303816000875af115801561130d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113319190612737565b505b4360068190556040519081527ffed9fcb0ca3d1e761a4b929792bb24082fba92dca81252646ad306d3068065669060200161072c565b6009546001600160a01b031633146113bf5760405162461bcd60e51b815260206004820152601960248201527839b2ba29b2b93b34b1b2a4b733379d102327a92124a22222a760391b6044820152606401610655565b6001600160a01b0382166114075760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610655565b600980546001600160a01b0319166001600160a01b038416179055600a8190556040517f232f2e6280d2064b1e439bf40ecdada042d84eefbb55039e4c49e8dc4f4c90c99061088c908490849061249b565b600c546040516370a0823160e01b81526000916001600160a01b0316906370a082319061148a9030906004016123ee565b602060405180830381865afa1580156114a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114cb9190612482565b905090565b6001600160a01b03811660009081526013602090815260408083208054600190910180548351818602810186019094528084526060949293919283919083018282801561153c57602002820191906000526020600020905b815481526020019060010190808311611528575b5050505050905091509150915091565b611554611d5d565b33600090815260136020526040902061156b611db6565b611573611e9e565b80546000036115825750611657565b60008160020154600254600d54846000015461159e919061262b565b6115a8919061264a565b6115b291906124ed565b9050801561161057806115c3611459565b10156115e15760405162461bcd60e51b81526004016106559061266c565b600c546115f8906001600160a01b03163383611d02565b806011600082825461160a91906126a3565b90915550505b600254600d548354611622919061262b565b61162c919061264a565b600283015560405181815233906000805160206127d58339815191529060200160405180910390a250505b6111ae60018055565b611668611d5d565b3360009081526013602052604090208054600e548111156116885750600e545b60008167ffffffffffffffff8111156116a3576116a361231a565b6040519080825280602002602001820160405280156116cc578160200160208202803683370190505b50905060005b828110156117cb57600180850180546000926116ed916124ed565b815481106116fd576116fd6126bb565b906000526020600020015490508460010180548061171d5761171d6126d1565b6001900381819060005260206000200160009055905580838381518110611746576117466126bb565b6020908102919091010152600b54604051632142170760e11b81526001600160a01b03909116906342842e0e90611785903090339086906004016126e7565b600060405180830381600087803b15801561179f57600080fd5b505af11580156117b3573d6000803e3d6000fd5b505050505080806117c39061270b565b9150506116d2565b5082546117d99083906124ed565b808455600254600d5490916117ee919061262b565b6117f8919061264a565b6002840155600f5461180b9083906124ed565b600f5560405133907f1ad6082f7aa3e32095e38fd4c0bf76fa2bb7584e81474cf3519d2dea4081181c90611840908490612724565b60405180910390a25050506111ae60018055565b61185c611ca8565b6001600160a01b0381166118c15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610655565b610e0581611f3b565b600080601254905060006011546118df611459565b6118e991906126a3565b90506005546000036119235761191a600454600754611908919061262b565b611912919061262b565b61191c90836126a3565b9150611951565b6000611933600854600654611f8b565b905080600754611943919061262b565b61194d90846126a3565b9250505b8181106119615760009250505090565b61196b81836124ed565b9250505090565b6001600160a01b0381166000908152601360205260408120600d546008544311801561199f5750600f5415155b80156119ad57506000600854115b156119fe5760006119c060085443611f8b565b90506000600754826119d2919061262b565b9050600f54600254826119e5919061262b565b6119ef919061264a565b6119f990846126a3565b925050505b60028083015490548354611a1390849061262b565b611a1d919061264a565b611a2791906124ed565b949350505050565b611a37611ca8565b600060055411611a7f5760405162461bcd60e51b81526020600482015260136024820152721c1bdbdb081a5cc81b9bdd081cdd185c9d1959606a1b6044820152606401610655565b4360065411611acc5760405162461bcd60e51b81526020600482015260196024820152781c1bdbdb081dd85cc8185b1c9958591e48199a5b9a5cda1959603a1b6044820152606401610655565b60008111611b0d5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610655565b611b15611e9e565b600c54611b2d906001600160a01b0316333084611fcc565b6000601154611b3a611459565b611b4491906126a3565b9050601254811115611bb557601254611b5d90826124ed565b9050600043600654611b6f91906124ed565b9050611b7b818361264a565b60078190556040519081527f0c4d677eef92893ac7ec52faf8140fc6c851ab4736302b4f3a89dfb20696a0df9060200160405180910390a1505b5050565b611bc1611ca8565b601e811015611c085760405162461bcd60e51b81526020600482015260136024820152721b1bddd95c881b1a5b5a5d081c995858da1959606a1b6044820152606401610655565b600481905560055415611c785761191a600454611c25919061262b565b600554611c3291906126a3565b60068190554310611c785760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b210323ab930ba34b7b760811b6044820152606401610655565b6040518181527f91abcc2d6823e3a3f11d31b208dd3065d2c6a791f1c7c9fe96a42ce12897eac59060200161072c565b6000546001600160a01b031633146111ae5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610655565b611d588363a9059cbb60e01b8484604051602401611d2192919061249b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611ff3565b505050565b600260015403611daf5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610655565b6002600155565b600a54341015611e1c5760405162461bcd60e51b815260206004820152602b60248201527f73686f756c642070617920736d616c6c2067617320746f20636f6d706f756e6460448201526a081bdc881a185c9d995cdd60aa1b6064820152608401610655565b600954600a546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015611e58573d6000803e3d6000fd5b50600a543411156111ae57600a5433906108fc90611e7690346124ed565b6040518115909202916000818181858888f19350505050158015610e05573d6000803e3d6000fd5b60085443111580611eaf5750600854155b15611eb657565b600f54600003611ec65743600855565b6000611ed460085443611f8b565b9050600060075482611ee6919061262b565b9050600f5460025482611ef9919061262b565b611f03919061264a565b600d6000828254611f1491906126a3565b90915550504360085560128054829190600090611f329084906126a3565b90915550505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006006548211611fa757611fa083836124ed565b9050611fc6565b6006548310611fb857506000611fc6565b82600654611fa091906124ed565b92915050565b611fed846323b872dd60e01b858585604051602401611d21939291906126e7565b50505050565b6000612048826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120c59092919063ffffffff16565b805190915015611d5857808060200190518101906120669190612737565b611d585760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610655565b6060611a27848460008585600080866001600160a01b031685876040516120ec9190612785565b60006040518083038185875af1925050503d8060008114612129576040519150601f19603f3d011682016040523d82523d6000602084013e61212e565b606091505b509150915061213f8783838761214a565b979650505050505050565b606083156121b95782516000036121b2576001600160a01b0385163b6121b25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610655565b5081611a27565b611a2783838151156121ce5781518083602001fd5b8060405162461bcd60e51b815260040161065591906127a1565b6000602082840312156121fa57600080fd5b5035919050565b6001600160a01b0381168114610e0557600080fd5b60006020828403121561222857600080fd5b813561223381612201565b9392505050565b60008060008060006080868803121561225257600080fd5b853561225d81612201565b9450602086013561226d81612201565b935060408601359250606086013567ffffffffffffffff8082111561229157600080fd5b818801915088601f8301126122a557600080fd5b8135818111156122b457600080fd5b8960208285010111156122c657600080fd5b9699959850939650602001949392505050565b6000806000606084860312156122ee57600080fd5b83356122f981612201565b9250602084013561230981612201565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561234357600080fd5b823567ffffffffffffffff8082111561235b57600080fd5b818501915085601f83011261236f57600080fd5b8135818111156123815761238161231a565b8060051b604051601f19603f830116810181811085821117156123a6576123a661231a565b6040529182528482019250838101850191888311156123c457600080fd5b938501935b828510156123e2578435845293850193928501926123c9565b98975050505050505050565b6001600160a01b0391909116815260200190565b6000806040838503121561241557600080fd5b823561242081612201565b946020939093013593505050565b600081518084526020808501945080840160005b8381101561245e57815187529582019590820190600101612442565b509495945050505050565b828152604060208201526000611a27604083018461242e565b60006020828403121561249457600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b6000602082840312156124c657600080fd5b815160ff8116811461223357600080fd5b634e487b7160e01b600052601160045260246000fd5b6000828210156124ff576124ff6124d7565b500390565b600181815b8085111561253f578160001904821115612525576125256124d7565b8085161561253257918102915b93841c9390800290612509565b509250929050565b60008261255657506001611fc6565b8161256357506000611fc6565b816001811461257957600281146125835761259f565b6001915050611fc6565b60ff841115612594576125946124d7565b50506001821b611fc6565b5060208310610133831016604e8410600b84101617156125c2575081810a611fc6565b6125cc8383612504565b80600019048211156125e0576125e06124d7565b029392505050565b60006122338383612547565b6020808252601c908201527f63616e6e6f7420657863656564206f6e652d74696d65206c696d697400000000604082015260600190565b6000816000190483118215151615612645576126456124d7565b500290565b60008261266757634e487b7160e01b600052601260045260246000fd5b500490565b6020808252601a908201527f496e73756666696369656e742072657761726420746f6b656e73000000000000604082015260600190565b600082198211156126b6576126b66124d7565b500190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006001820161271d5761271d6124d7565b5060010190565b602081526000612233602083018461242e565b60006020828403121561274957600080fd5b8151801515811461223357600080fd5b60005b8381101561277457818101518382015260200161275c565b83811115611fed5750506000910152565b60008251612797818460208701612759565b9190910192915050565b60208152600082518060208401526127c0816040850160208701612759565b601f01601f1916919091016040019291505056fe47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4a2646970667358221220627a39927cc6dabd68e95b318e99f760728e52fccfa9fce9f46093ef03aa2b9964736f6c634300080e0033

Deployed Bytecode

0x6080604052600436106101d15760003560e01c806380dc0672116100f8578063a9f8d18111610090578063a9f8d18114610513578063b493877714610529578063b88a802f14610557578063db2e21bc1461055f578063f2fde38b14610574578063f3aeb31d14610594578063f40f0f52146105a9578063f4ef5ed5146105c9578063f6be71d1146105e957600080fd5b806380dc06721461043d578063817b1cd21461045257806381b619481461046857806387788782146104885780638ae39cac1461049e5780638da5cb5b146104b45780638f662915146104d25780639f94e272146104e8578063a2cd12d2146104fd57600080fd5b80633279beab1161016b5780633279beab14610333578063392e53cd1461035357806348cd4cb11461037d578063598b8e711461039357806361d027b3146103a65780636982d815146103d35780636e707b73146103f3578063715018a614610413578063746c8ae11461042857600080fd5b80626f0231146101dd578062ae3bf8146101ff57806301f8a9761461021f5780630fb5a6b41461023f578063150b7a02146102685780631794bb3c146102a15780631959a002146102c15780631aed65531461030a5780632e1a7d4d1461032057600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b506101fd6101f83660046121e8565b610609565b005b34801561020b57600080fd5b506101fd61021a366004612216565b610737565b34801561022b57600080fd5b506101fd61023a3660046121e8565b610898565b34801561024b57600080fd5b5061025560045481565b6040519081526020015b60405180910390f35b34801561027457600080fd5b5061028861028336600461223a565b6108d5565b6040516001600160e01b0319909116815260200161025f565b3480156102ad57600080fd5b506101fd6102bc3660046122d9565b610936565b3480156102cd57600080fd5b506102f56102dc366004612216565b6013602052600090815260409020805460029091015482565b6040805192835260208301919091520161025f565b34801561031657600080fd5b5061025560065481565b6101fd61032e3660046121e8565b610a96565b34801561033f57600080fd5b506101fd61034e3660046121e8565b610e08565b34801561035f57600080fd5b5060035461036d9060ff1681565b604051901515815260200161025f565b34801561038957600080fd5b5061025560055481565b6101fd6103a1366004612330565b610ea4565b3480156103b257600080fd5b506009546103c6906001600160a01b031681565b60405161025f91906123ee565b3480156103df57600080fd5b50600b546103c6906001600160a01b031681565b3480156103ff57600080fd5b50600c546103c6906001600160a01b031681565b34801561041f57600080fd5b506101fd61119c565b34801561043457600080fd5b506101fd6111b0565b34801561044957600080fd5b506101fd61127b565b34801561045e57600080fd5b50610255600f5481565b34801561047457600080fd5b506101fd610483366004612402565b611369565b34801561049457600080fd5b50610255600a5481565b3480156104aa57600080fd5b5061025560075481565b3480156104c057600080fd5b506000546001600160a01b03166103c6565b3480156104de57600080fd5b50610255600d5481565b3480156104f457600080fd5b50610255611459565b34801561050957600080fd5b50610255600e5481565b34801561051f57600080fd5b5061025560085481565b34801561053557600080fd5b50610549610544366004612216565b6114d0565b60405161025f929190612469565b6101fd61154c565b34801561056b57600080fd5b506101fd611660565b34801561058057600080fd5b506101fd61058f366004612216565b611854565b3480156105a057600080fd5b506102556118ca565b3480156105b557600080fd5b506102556105c4366004612216565b611972565b3480156105d557600080fd5b506101fd6105e43660046121e8565b611a2f565b3480156105f557600080fd5b506101fd6106043660046121e8565b611bb9565b610611611ca8565b60006005541161065e5760405162461bcd60e51b8152602060048201526013602482015272141bdbdb081a5cc81b9bdd081cdd185c9d1959606a1b60448201526064015b60405180910390fd5b43600654116106ab5760405162461bcd60e51b8152602060048201526019602482015278141bdbdb081dd85cc8185b1c9958591e48199a5b9a5cda1959603a1b6044820152606401610655565b43811180156106bb575060055481115b6106fb5760405162461bcd60e51b8152602060048201526011602482015270496e76616c696420656e6420626c6f636b60781b6044820152606401610655565b60068190556040518181527f0972575658363b3e7c472ab3a6a918726742c853b732f6a4a2763e2e3a94c977906020015b60405180910390a150565b61073f611ca8565b600c546001600160a01b03908116908216036107965760405162461bcd60e51b815260206004820152601660248201527521b0b73737ba103132903932bbb0b932103a37b5b2b760511b6044820152606401610655565b476001600160a01b0382166107d857604051339082156108fc029083906000818181858888f193505050501580156107d2573d6000803e3d6000fd5b5061085b565b6040516370a0823160e01b81526001600160a01b038316906370a08231906108049030906004016123ee565b602060405180830381865afa158015610821573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108459190612482565b905061085b6001600160a01b0383163383611d02565b7f74f5dcd55c394cb1c6d3b9da22c2464bcc46c38cc3865bd629ed75823249b40b828260405161088c92919061249b565b60405180910390a15050565b6108a0611ca8565b60078190556040518181527f0c4d677eef92893ac7ec52faf8140fc6c851ab4736302b4f3a89dfb20696a0df9060200161072c565b600b546000906001600160a01b031633146109245760405162461bcd60e51b815260206004820152600f60248201526e1b9bdd08195b98589b195908139195608a1b6044820152606401610655565b50630a85bd0160e11b95945050505050565b61093e611ca8565b60035460ff16156109875760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401610655565b6003805460ff19166001179055600b80546001600160a01b038086166001600160a01b031992831617909255600c8054928516929091168217905560078290556040805163313ce56760e01b815290516000929163313ce5679160048281019260209291908290030181865afa158015610a05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2991906124b4565b60ff169050601e8110610a775760405162461bcd60e51b815260206004820152601660248201527504d75737420626520696e666572696f7220746f2033360541b6044820152606401610655565b610a828160286124ed565b610a8d90600a6125e8565b60025550505050565b610a9e611d5d565b60008111610aee5760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e742073686f756c642062652067726561746f72207468616e2030006044820152606401610655565b600e54811115610b105760405162461bcd60e51b8152600401610655906125f4565b3360009081526013602052604090208054821115610b705760405162461bcd60e51b815260206004820152601b60248201527f416d6f756e7420746f20776974686472617720746f6f206869676800000000006044820152606401610655565b610b78611db6565b610b80611e9e565b805415610c3a5760008160020154600254600d548460000154610ba3919061262b565b610bad919061264a565b610bb791906124ed565b90508015610c385780610bc8611459565b1015610be65760405162461bcd60e51b81526004016106559061266c565b600c54610bfd906001600160a01b03163383611d02565b8060116000828254610c0f91906126a3565b909155505060405181815233906000805160206127d58339815191529060200160405180910390a25b505b60008267ffffffffffffffff811115610c5557610c5561231a565b604051908082528060200260200182016040528015610c7e578160200160208202803683370190505b50905060005b83811015610d7d5760018084018054600092610c9f916124ed565b81548110610caf57610caf6126bb565b9060005260206000200154905083600101805480610ccf57610ccf6126d1565b6001900381819060005260206000200160009055905580838381518110610cf857610cf86126bb565b6020908102919091010152600b54604051632142170760e11b81526001600160a01b03909116906342842e0e90610d37903090339086906004016126e7565b600060405180830381600087803b158015610d5157600080fd5b505af1158015610d65573d6000803e3d6000fd5b50505050508080610d759061270b565b915050610c84565b508154610d8b9084906124ed565b808355600254600d549091610da0919061262b565b610daa919061264a565b6002830155600f54610dbd9084906124ed565b600f5560405133907f67e9df8b3c7743c9f1b625ba4f2b4e601206dbd46ed5c33c85a1242e4d23a2d190610df2908490612724565b60405180910390a25050610e0560018055565b50565b610e10611ca8565b6006544311610e535760405162461bcd60e51b815260206004820152600f60248201526e506f6f6c2069732072756e6e696e6760881b6044820152606401610655565b80610e5c611459565b1015610e7a5760405162461bcd60e51b81526004016106559061266c565b80600003610e8d57610e8a611459565b90505b600c54610e05906001600160a01b03163383611d02565b610eac611d5d565b6000600554118015610ebf575043600554105b610f0b5760405162461bcd60e51b815260206004820152601a60248201527f5374616b696e67206861736e27742073746172746564207965740000000000006044820152606401610655565b6000815111610f5c5760405162461bcd60e51b815260206004820152601d60248201527f6d75737420616464206174206c65617374206f6e6520746f6b656e49640000006044820152606401610655565b600e5481511115610f7f5760405162461bcd60e51b8152600401610655906125f4565b610f87611db6565b610f8f611e9e565b3360009081526013602052604090208054156110585760008160020154600254600d548460000154610fc1919061262b565b610fcb919061264a565b610fd591906124ed565b905080156110565780610fe6611459565b10156110045760405162461bcd60e51b81526004016106559061266c565b600c5461101b906001600160a01b03163383611d02565b806011600082825461102d91906126a3565b909155505060405181815233906000805160206127d58339815191529060200160405180910390a25b505b60005b8251811015611113576000838281518110611078576110786126bb565b6020908102919091010151600b54604051632142170760e11b81529192506001600160a01b0316906342842e0e906110b8903390309086906004016126e7565b600060405180830381600087803b1580156110d257600080fd5b505af11580156110e6573d6000803e3d6000fd5b5050505060018381018054918201815560009081526020902001558061110b8161270b565b91505061105b565b508151815461112291906126a3565b808255600254600d549091611137919061262b565b611141919061264a565b60028201558151600f5461115591906126a3565b600f5560405133907fff409334d2645d660e7cfa41a637aa21f45a79ecb9660a6931aa923bf75577c79061118a908590612724565b60405180910390a250610e0560018055565b6111a4611ca8565b6111ae6000611f3b565b565b6111b8611ca8565b600554156112035760405162461bcd60e51b8152602060048201526018602482015277141bdbdb081dd85cc8185b1c9958591e481cdd185c9d195960421b6044820152606401610655565b61120e4360646126a3565b6005556004546112219061191a9061262b565b60055461122e91906126a3565b600681905560055460088190556040517f7cd0ab87d19036f3dfadadb232c78aa4879dda3f0c994a9d637532410ee2ce0692611271928252602082015260400190565b60405180910390a1565b611283611ca8565b61128b611e9e565b6000601154611298611459565b6112a291906126a3565b9050601254811115611333576012546112bb90826124ed565b600c5460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb906112ee903390859060040161249b565b6020604051808303816000875af115801561130d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113319190612737565b505b4360068190556040519081527ffed9fcb0ca3d1e761a4b929792bb24082fba92dca81252646ad306d3068065669060200161072c565b6009546001600160a01b031633146113bf5760405162461bcd60e51b815260206004820152601960248201527839b2ba29b2b93b34b1b2a4b733379d102327a92124a22222a760391b6044820152606401610655565b6001600160a01b0382166114075760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610655565b600980546001600160a01b0319166001600160a01b038416179055600a8190556040517f232f2e6280d2064b1e439bf40ecdada042d84eefbb55039e4c49e8dc4f4c90c99061088c908490849061249b565b600c546040516370a0823160e01b81526000916001600160a01b0316906370a082319061148a9030906004016123ee565b602060405180830381865afa1580156114a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114cb9190612482565b905090565b6001600160a01b03811660009081526013602090815260408083208054600190910180548351818602810186019094528084526060949293919283919083018282801561153c57602002820191906000526020600020905b815481526020019060010190808311611528575b5050505050905091509150915091565b611554611d5d565b33600090815260136020526040902061156b611db6565b611573611e9e565b80546000036115825750611657565b60008160020154600254600d54846000015461159e919061262b565b6115a8919061264a565b6115b291906124ed565b9050801561161057806115c3611459565b10156115e15760405162461bcd60e51b81526004016106559061266c565b600c546115f8906001600160a01b03163383611d02565b806011600082825461160a91906126a3565b90915550505b600254600d548354611622919061262b565b61162c919061264a565b600283015560405181815233906000805160206127d58339815191529060200160405180910390a250505b6111ae60018055565b611668611d5d565b3360009081526013602052604090208054600e548111156116885750600e545b60008167ffffffffffffffff8111156116a3576116a361231a565b6040519080825280602002602001820160405280156116cc578160200160208202803683370190505b50905060005b828110156117cb57600180850180546000926116ed916124ed565b815481106116fd576116fd6126bb565b906000526020600020015490508460010180548061171d5761171d6126d1565b6001900381819060005260206000200160009055905580838381518110611746576117466126bb565b6020908102919091010152600b54604051632142170760e11b81526001600160a01b03909116906342842e0e90611785903090339086906004016126e7565b600060405180830381600087803b15801561179f57600080fd5b505af11580156117b3573d6000803e3d6000fd5b505050505080806117c39061270b565b9150506116d2565b5082546117d99083906124ed565b808455600254600d5490916117ee919061262b565b6117f8919061264a565b6002840155600f5461180b9083906124ed565b600f5560405133907f1ad6082f7aa3e32095e38fd4c0bf76fa2bb7584e81474cf3519d2dea4081181c90611840908490612724565b60405180910390a25050506111ae60018055565b61185c611ca8565b6001600160a01b0381166118c15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610655565b610e0581611f3b565b600080601254905060006011546118df611459565b6118e991906126a3565b90506005546000036119235761191a600454600754611908919061262b565b611912919061262b565b61191c90836126a3565b9150611951565b6000611933600854600654611f8b565b905080600754611943919061262b565b61194d90846126a3565b9250505b8181106119615760009250505090565b61196b81836124ed565b9250505090565b6001600160a01b0381166000908152601360205260408120600d546008544311801561199f5750600f5415155b80156119ad57506000600854115b156119fe5760006119c060085443611f8b565b90506000600754826119d2919061262b565b9050600f54600254826119e5919061262b565b6119ef919061264a565b6119f990846126a3565b925050505b60028083015490548354611a1390849061262b565b611a1d919061264a565b611a2791906124ed565b949350505050565b611a37611ca8565b600060055411611a7f5760405162461bcd60e51b81526020600482015260136024820152721c1bdbdb081a5cc81b9bdd081cdd185c9d1959606a1b6044820152606401610655565b4360065411611acc5760405162461bcd60e51b81526020600482015260196024820152781c1bdbdb081dd85cc8185b1c9958591e48199a5b9a5cda1959603a1b6044820152606401610655565b60008111611b0d5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610655565b611b15611e9e565b600c54611b2d906001600160a01b0316333084611fcc565b6000601154611b3a611459565b611b4491906126a3565b9050601254811115611bb557601254611b5d90826124ed565b9050600043600654611b6f91906124ed565b9050611b7b818361264a565b60078190556040519081527f0c4d677eef92893ac7ec52faf8140fc6c851ab4736302b4f3a89dfb20696a0df9060200160405180910390a1505b5050565b611bc1611ca8565b601e811015611c085760405162461bcd60e51b81526020600482015260136024820152721b1bddd95c881b1a5b5a5d081c995858da1959606a1b6044820152606401610655565b600481905560055415611c785761191a600454611c25919061262b565b600554611c3291906126a3565b60068190554310611c785760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b210323ab930ba34b7b760811b6044820152606401610655565b6040518181527f91abcc2d6823e3a3f11d31b208dd3065d2c6a791f1c7c9fe96a42ce12897eac59060200161072c565b6000546001600160a01b031633146111ae5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610655565b611d588363a9059cbb60e01b8484604051602401611d2192919061249b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611ff3565b505050565b600260015403611daf5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610655565b6002600155565b600a54341015611e1c5760405162461bcd60e51b815260206004820152602b60248201527f73686f756c642070617920736d616c6c2067617320746f20636f6d706f756e6460448201526a081bdc881a185c9d995cdd60aa1b6064820152608401610655565b600954600a546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015611e58573d6000803e3d6000fd5b50600a543411156111ae57600a5433906108fc90611e7690346124ed565b6040518115909202916000818181858888f19350505050158015610e05573d6000803e3d6000fd5b60085443111580611eaf5750600854155b15611eb657565b600f54600003611ec65743600855565b6000611ed460085443611f8b565b9050600060075482611ee6919061262b565b9050600f5460025482611ef9919061262b565b611f03919061264a565b600d6000828254611f1491906126a3565b90915550504360085560128054829190600090611f329084906126a3565b90915550505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006006548211611fa757611fa083836124ed565b9050611fc6565b6006548310611fb857506000611fc6565b82600654611fa091906124ed565b92915050565b611fed846323b872dd60e01b858585604051602401611d21939291906126e7565b50505050565b6000612048826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120c59092919063ffffffff16565b805190915015611d5857808060200190518101906120669190612737565b611d585760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610655565b6060611a27848460008585600080866001600160a01b031685876040516120ec9190612785565b60006040518083038185875af1925050503d8060008114612129576040519150601f19603f3d011682016040523d82523d6000602084013e61212e565b606091505b509150915061213f8783838761214a565b979650505050505050565b606083156121b95782516000036121b2576001600160a01b0385163b6121b25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610655565b5081611a27565b611a2783838151156121ce5781518083602001fd5b8060405162461bcd60e51b815260040161065591906127a1565b6000602082840312156121fa57600080fd5b5035919050565b6001600160a01b0381168114610e0557600080fd5b60006020828403121561222857600080fd5b813561223381612201565b9392505050565b60008060008060006080868803121561225257600080fd5b853561225d81612201565b9450602086013561226d81612201565b935060408601359250606086013567ffffffffffffffff8082111561229157600080fd5b818801915088601f8301126122a557600080fd5b8135818111156122b457600080fd5b8960208285010111156122c657600080fd5b9699959850939650602001949392505050565b6000806000606084860312156122ee57600080fd5b83356122f981612201565b9250602084013561230981612201565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561234357600080fd5b823567ffffffffffffffff8082111561235b57600080fd5b818501915085601f83011261236f57600080fd5b8135818111156123815761238161231a565b8060051b604051601f19603f830116810181811085821117156123a6576123a661231a565b6040529182528482019250838101850191888311156123c457600080fd5b938501935b828510156123e2578435845293850193928501926123c9565b98975050505050505050565b6001600160a01b0391909116815260200190565b6000806040838503121561241557600080fd5b823561242081612201565b946020939093013593505050565b600081518084526020808501945080840160005b8381101561245e57815187529582019590820190600101612442565b509495945050505050565b828152604060208201526000611a27604083018461242e565b60006020828403121561249457600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b6000602082840312156124c657600080fd5b815160ff8116811461223357600080fd5b634e487b7160e01b600052601160045260246000fd5b6000828210156124ff576124ff6124d7565b500390565b600181815b8085111561253f578160001904821115612525576125256124d7565b8085161561253257918102915b93841c9390800290612509565b509250929050565b60008261255657506001611fc6565b8161256357506000611fc6565b816001811461257957600281146125835761259f565b6001915050611fc6565b60ff841115612594576125946124d7565b50506001821b611fc6565b5060208310610133831016604e8410600b84101617156125c2575081810a611fc6565b6125cc8383612504565b80600019048211156125e0576125e06124d7565b029392505050565b60006122338383612547565b6020808252601c908201527f63616e6e6f7420657863656564206f6e652d74696d65206c696d697400000000604082015260600190565b6000816000190483118215151615612645576126456124d7565b500290565b60008261266757634e487b7160e01b600052601260045260246000fd5b500490565b6020808252601a908201527f496e73756666696369656e742072657761726420746f6b656e73000000000000604082015260600190565b600082198211156126b6576126b66124d7565b500190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006001820161271d5761271d6124d7565b5060010190565b602081526000612233602083018461242e565b60006020828403121561274957600080fd5b8151801515811461223357600080fd5b60005b8381101561277457818101518382015260200161275c565b83811115611fed5750506000910152565b60008251612797818460208701612759565b9190910192915050565b60208152600082518060208401526127c0816040850160208701612759565b601f01601f1916919091016040019291505056fe47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4a2646970667358221220627a39927cc6dabd68e95b318e99f760728e52fccfa9fce9f46093ef03aa2b9964736f6c634300080e0033

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ 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.