ETH Price: $2,621.48 (+1.07%)

Token

Moontography Staking Token (sMTGY)
 

Overview

Max Total Supply

80,258.260939725786287315 sMTGY

Holders

26

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x81E71861...F868A7Ec8
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
MTGYFaaSToken

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 14 : MTGYFaaSToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/utils/math/SafeMath.sol';

/**
 * @title MTGYFaaSToken (sMTGY)
 * @author Lance Whatley
 * @notice Represents a contract where a token owner has put her tokens up for others to stake and earn said tokens.
 */
contract MTGYFaaSToken is ERC20 {
  using SafeMath for uint256;
  bool public contractIsRemoved = false;

  ERC20 private _rewardsToken;
  ERC20 private _stakedERC20;
  ERC721 private _stakedERC721;
  PoolInfo public pool;
  address private constant _burner = 0x000000000000000000000000000000000000dEaD;

  struct PoolInfo {
    address creator; // address of contract creator
    address tokenOwner; // address of original rewards token owner
    uint256 origTotSupply; // supply of rewards tokens put up to be rewarded by original owner
    uint256 curRewardsSupply; // current supply of rewards
    uint256 totalTokensStaked; // current amount of tokens staked
    uint256 creationBlock; // block this contract was created
    uint256 perBlockNum; // amount of rewards tokens rewarded per block
    uint256 lockedUntilDate; // unix timestamp of how long this contract is locked and can't be changed
    // uint256 allocPoint; // How many allocation points assigned to this pool. ERC20s to distribute per block.
    uint256 lastRewardBlock; // Last block number that ERC20s distribution occurs.
    uint256 accERC20PerShare; // Accumulated ERC20s per share, times 1e36.
    uint256 stakeTimeLockSec; // number of seconds after depositing the user is required to stake before unstaking
    bool isStakedNft;
  }

  struct StakerInfo {
    uint256 blockOriginallyStaked; // block the user originally staked
    uint256 timeOriginallyStaked; // unix timestamp in seconds that the user originally staked
    uint256 blockLastHarvested; // the block the user last claimed/harvested rewards
    uint256 rewardDebt; // Reward debt. See explanation below.
    uint256[] nftTokenIds; // if this is an NFT staking pool, make sure we store the token IDs here
  }

  struct BlockTokenTotal {
    uint256 blockNumber;
    uint256 totalTokens;
  }

  // mapping of userAddresses => tokenAddresses that can
  // can be evaluated to determine for a particular user which tokens
  // they are staking.
  mapping(address => StakerInfo) public stakers;

  event Deposit(address indexed user, uint256 amount);
  event Withdraw(address indexed user, uint256 amount);

  /**
   * @notice The constructor for the Staking Token.
   * @param _name Name of the staking token
   * @param _symbol Name of the staking token symbol
   * @param _rewardSupply The amount of tokens to mint on construction, this should be the same as the tokens provided by the creating user.
   * @param _rewardsTokenAddy Contract address of token to be rewarded to users
   * @param _stakedTokenAddy Contract address of token to be staked by users
   * @param _originalTokenOwner Address of user putting up staking tokens to be staked
   * @param _perBlockAmount Amount of tokens to be rewarded per block
   * @param _lockedUntilDate Unix timestamp that the staked tokens will be locked. 0 means locked forever until all tokens are staked
   * @param _stakeTimeLockSec number of seconds a user is required to stake, or 0 if none
   * @param _isStakedNft is this an NFT staking pool
   */
  constructor(
    string memory _name,
    string memory _symbol,
    uint256 _rewardSupply,
    address _rewardsTokenAddy,
    address _stakedTokenAddy,
    address _originalTokenOwner,
    uint256 _perBlockAmount,
    uint256 _lockedUntilDate,
    uint256 _stakeTimeLockSec,
    bool _isStakedNft
  ) ERC20(_name, _symbol) {
    require(
      _perBlockAmount > uint256(0) && _perBlockAmount <= uint256(_rewardSupply),
      'per block amount must be more than 0 and less than supply'
    );

    // A locked date of '0' corresponds to being locked forever until the supply has expired and been rewards to all stakers
    require(
      _lockedUntilDate > block.timestamp || _lockedUntilDate == 0,
      'locked time must be after now or 0'
    );

    _rewardsToken = ERC20(_rewardsTokenAddy);
    if (_isStakedNft) {
      _stakedERC721 = ERC721(_stakedTokenAddy);
    } else {
      _stakedERC20 = ERC20(_stakedTokenAddy);
    }

    pool = PoolInfo({
      creator: msg.sender,
      tokenOwner: _originalTokenOwner,
      origTotSupply: _rewardSupply,
      curRewardsSupply: _rewardSupply,
      totalTokensStaked: 0,
      creationBlock: 0,
      perBlockNum: _perBlockAmount,
      lockedUntilDate: _lockedUntilDate,
      lastRewardBlock: block.number,
      accERC20PerShare: 0,
      stakeTimeLockSec: _stakeTimeLockSec,
      isStakedNft: _isStakedNft
    });
  }

  // SHOULD ONLY BE CALLED AT CONTRACT CREATION and allows changing
  // the initial supply if tokenomics of token transfer causes
  // the original staking contract supply to be less than the original
  function updateSupply(uint256 _newSupply) external {
    require(
      msg.sender == pool.creator,
      'only contract creator can update the supply'
    );
    pool.origTotSupply = _newSupply;
    pool.curRewardsSupply = _newSupply;
  }

  function stakedTokenAddress() external view returns (address) {
    return pool.isStakedNft ? address(_stakedERC721) : address(_stakedERC20);
  }

  function rewardsTokenAddress() external view returns (address) {
    return address(_rewardsToken);
  }

  function tokenOwner() external view returns (address) {
    return pool.tokenOwner;
  }

  function getLockedUntilDate() external view returns (uint256) {
    return pool.lockedUntilDate;
  }

  function removeStakeableTokens() external {
    require(
      msg.sender == pool.creator || msg.sender == pool.tokenOwner,
      'caller must be the contract creator or owner to remove stakable tokens'
    );
    _rewardsToken.transfer(pool.tokenOwner, pool.curRewardsSupply);
    pool.curRewardsSupply = 0;
    contractIsRemoved = true;
  }

  // function updateTimestamp(uint256 _newTime) external {
  //   require(
  //     msg.sender == tokenOwner,
  //     'updateTimestamp user must be original token owner'
  //   );
  //   require(
  //     _newTime > lockedUntilDate || _newTime == 0,
  //     'you cannot change timestamp if it is before the locked time or was set to be locked forever'
  //   );
  //   lockedUntilDate = _newTime;
  // }

  function stakeTokens(uint256 _amount, uint256[] memory _tokenIds) external {
    require(
      getLastStakableBlock() > block.number,
      'this farm is expired and no more stakers can be added'
    );

    _updatePool();

    if (balanceOf(msg.sender) > 0) {
      _harvestTokens(msg.sender);
    }

    uint256 _finalAmountTransferred;
    if (pool.isStakedNft) {
      require(
        _tokenIds.length > 0,
        "you need to provide NFT token IDs you're staking"
      );
      for (uint256 _i = 0; _i < _tokenIds.length; _i++) {
        _stakedERC721.transferFrom(msg.sender, address(this), _tokenIds[_i]);
      }

      _finalAmountTransferred = _tokenIds.length;
    } else {
      uint256 _contractBalanceBefore = _stakedERC20.balanceOf(address(this));
      _stakedERC20.transferFrom(msg.sender, address(this), _amount);

      // in the event a token contract on transfer taxes, burns, etc. tokens
      // the contract might not get the entire amount that the user originally
      // transferred. Need to calculate from the previous contract balance
      // so we know how many were actually transferred.
      _finalAmountTransferred = _stakedERC20.balanceOf(address(this)).sub(
        _contractBalanceBefore
      );
    }

    if (totalSupply() == 0) {
      pool.creationBlock = block.number;
      pool.lastRewardBlock = block.number;
    }
    _mint(msg.sender, _finalAmountTransferred);
    StakerInfo storage _staker = stakers[msg.sender];
    _staker.blockOriginallyStaked = block.number;
    _staker.timeOriginallyStaked = block.timestamp;
    _staker.blockLastHarvested = block.number;
    _staker.rewardDebt = balanceOf(msg.sender).mul(pool.accERC20PerShare).div(
      1e36
    );
    for (uint256 _i = 0; _i < _tokenIds.length; _i++) {
      _staker.nftTokenIds.push(_tokenIds[_i]);
    }
    _updNumStaked(_finalAmountTransferred, 'add');
    emit Deposit(msg.sender, _finalAmountTransferred);
  }

  // pass 'false' for shouldHarvest for emergency unstaking without claiming rewards
  function unstakeTokens(uint256 _amount, bool shouldHarvest) external {
    StakerInfo memory _staker = stakers[msg.sender];
    uint256 _userBalance = balanceOf(msg.sender);
    require(
      pool.isStakedNft ? true : _amount <= _userBalance,
      'user can only unstake amount they have currently staked or less'
    );

    // allow unstaking if the user is emergency unstaking and not getting rewards or
    // if theres a time lock that it's past the time lock or
    // the contract rewards were removed by the original contract creator or
    // the contract is expired
    require(
      !shouldHarvest ||
        block.timestamp >=
        _staker.timeOriginallyStaked.add(pool.stakeTimeLockSec) ||
        contractIsRemoved ||
        block.number > getLastStakableBlock(),
      'you have not staked for minimum time lock yet and the pool is not expired'
    );

    _updatePool();

    if (shouldHarvest) {
      _harvestTokens(msg.sender);
    }

    uint256 _amountToRemoveFromStaked = pool.isStakedNft
      ? _userBalance
      : _amount;
    transfer(_burner, _amountToRemoveFromStaked);
    if (pool.isStakedNft) {
      for (uint256 _i = 0; _i < _staker.nftTokenIds.length; _i++) {
        _stakedERC721.transferFrom(
          address(this),
          msg.sender,
          _staker.nftTokenIds[_i]
        );
      }
    } else {
      require(
        _stakedERC20.transfer(msg.sender, _amountToRemoveFromStaked),
        'unable to send user original tokens'
      );
    }

    if (balanceOf(msg.sender) <= 0) {
      delete stakers[msg.sender];
    }
    _updNumStaked(_amountToRemoveFromStaked, 'remove');
    emit Withdraw(msg.sender, _amountToRemoveFromStaked);
  }

  function emergencyUnstake() external {
    StakerInfo memory _staker = stakers[msg.sender];
    uint256 _amountToRemoveFromStaked = balanceOf(msg.sender);
    require(
      _amountToRemoveFromStaked > 0,
      'user can only unstake if they have tokens in the pool'
    );

    transfer(_burner, _amountToRemoveFromStaked);
    if (pool.isStakedNft) {
      for (uint256 _i = 0; _i < _staker.nftTokenIds.length; _i++) {
        _stakedERC721.transferFrom(
          address(this),
          msg.sender,
          _staker.nftTokenIds[_i]
        );
      }
    } else {
      require(
        _stakedERC20.transfer(msg.sender, _amountToRemoveFromStaked),
        'unable to send user original tokens'
      );
    }

    delete stakers[msg.sender];
    _updNumStaked(_amountToRemoveFromStaked, 'remove');
    emit Withdraw(msg.sender, _amountToRemoveFromStaked);
  }

  function harvestForUser(address _userAddy) public returns (uint256) {
    require(
      msg.sender == pool.creator || msg.sender == _userAddy,
      'can only harvest tokens for someone else if this was the contract creator'
    );
    _updatePool();
    return _harvestTokens(_userAddy);
  }

  function getLastStakableBlock() public view returns (uint256) {
    uint256 _blockToAdd = pool.creationBlock == 0
      ? block.number
      : pool.creationBlock;
    return pool.origTotSupply.div(pool.perBlockNum).add(_blockToAdd);
  }

  function calcHarvestTot(address _userAddy) public view returns (uint256) {
    StakerInfo memory _staker = stakers[_userAddy];

    if (
      _staker.blockLastHarvested >= block.number ||
      _staker.blockOriginallyStaked == 0 ||
      pool.totalTokensStaked == 0
    ) {
      return uint256(0);
    }

    uint256 _accERC20PerShare = pool.accERC20PerShare;

    if (block.number > pool.lastRewardBlock && pool.totalTokensStaked != 0) {
      uint256 _endBlock = getLastStakableBlock();
      uint256 _lastBlock = block.number < _endBlock ? block.number : _endBlock;
      uint256 _nrOfBlocks = _lastBlock.sub(pool.lastRewardBlock);
      uint256 _erc20Reward = _nrOfBlocks.mul(pool.perBlockNum);
      _accERC20PerShare = _accERC20PerShare.add(
        _erc20Reward.mul(1e36).div(pool.totalTokensStaked)
      );
    }

    return
      balanceOf(_userAddy).mul(_accERC20PerShare).div(1e36).sub(
        _staker.rewardDebt
      );
  }

  // Update reward variables of the given pool to be up-to-date.
  function _updatePool() private {
    uint256 _endBlock = getLastStakableBlock();
    uint256 _lastBlock = block.number < _endBlock ? block.number : _endBlock;

    if (_lastBlock <= pool.lastRewardBlock) {
      return;
    }
    uint256 _stakedSupply = pool.totalTokensStaked;
    if (_stakedSupply == 0) {
      pool.lastRewardBlock = _lastBlock;
      return;
    }

    uint256 _nrOfBlocks = _lastBlock.sub(pool.lastRewardBlock);
    uint256 _erc20Reward = _nrOfBlocks.mul(pool.perBlockNum);

    pool.accERC20PerShare = pool.accERC20PerShare.add(
      _erc20Reward.mul(1e36).div(_stakedSupply)
    );
    pool.lastRewardBlock = _lastBlock;
  }

  function _harvestTokens(address _userAddy) private returns (uint256) {
    StakerInfo storage _staker = stakers[_userAddy];
    require(_staker.blockOriginallyStaked > 0, 'user must have tokens staked');

    uint256 _num2Trans = calcHarvestTot(_userAddy);
    if (_num2Trans > 0) {
      require(
        _rewardsToken.transfer(_userAddy, _num2Trans),
        'unable to send user their harvested tokens'
      );
      pool.curRewardsSupply = pool.curRewardsSupply.sub(_num2Trans);
    }
    _staker.rewardDebt = balanceOf(_userAddy).mul(pool.accERC20PerShare).div(
      1e36
    );
    _staker.blockLastHarvested = block.number;
    return _num2Trans;
  }

  // update the amount currently staked after a user harvests
  function _updNumStaked(uint256 _amount, string memory _operation) private {
    if (_compareStr(_operation, 'remove')) {
      pool.totalTokensStaked = pool.totalTokensStaked.sub(_amount);
    } else {
      pool.totalTokensStaked = pool.totalTokensStaked.add(_amount);
    }
  }

  function _compareStr(string memory a, string memory b)
    private
    pure
    returns (bool)
  {
    return (keccak256(abi.encodePacked((a))) ==
      keccak256(abi.encodePacked((b))));
  }
}

File 2 of 14 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 3 of 14 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

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

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

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

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

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

        _balances[to] += 1;
        _owners[tokenId] = to;

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

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

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

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

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

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

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

File 4 of 14 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 5 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

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

File 6 of 14 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

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

File 7 of 14 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

File 8 of 14 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 9 of 14 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 10 of 14 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 11 of 14 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev 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) {
        require(isContract(target), "Address: delegate call to non-contract");

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

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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 12 of 14 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

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

File 13 of 14 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint256","name":"_rewardSupply","type":"uint256"},{"internalType":"address","name":"_rewardsTokenAddy","type":"address"},{"internalType":"address","name":"_stakedTokenAddy","type":"address"},{"internalType":"address","name":"_originalTokenOwner","type":"address"},{"internalType":"uint256","name":"_perBlockAmount","type":"uint256"},{"internalType":"uint256","name":"_lockedUntilDate","type":"uint256"},{"internalType":"uint256","name":"_stakeTimeLockSec","type":"uint256"},{"internalType":"bool","name":"_isStakedNft","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_userAddy","type":"address"}],"name":"calcHarvestTot","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractIsRemoved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getLastStakableBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLockedUntilDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_userAddy","type":"address"}],"name":"harvestForUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pool","outputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"address","name":"tokenOwner","type":"address"},{"internalType":"uint256","name":"origTotSupply","type":"uint256"},{"internalType":"uint256","name":"curRewardsSupply","type":"uint256"},{"internalType":"uint256","name":"totalTokensStaked","type":"uint256"},{"internalType":"uint256","name":"creationBlock","type":"uint256"},{"internalType":"uint256","name":"perBlockNum","type":"uint256"},{"internalType":"uint256","name":"lockedUntilDate","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accERC20PerShare","type":"uint256"},{"internalType":"uint256","name":"stakeTimeLockSec","type":"uint256"},{"internalType":"bool","name":"isStakedNft","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"removeStakeableTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"stakeTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakedTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakers","outputs":[{"internalType":"uint256","name":"blockOriginallyStaked","type":"uint256"},{"internalType":"uint256","name":"timeOriginallyStaked","type":"uint256"},{"internalType":"uint256","name":"blockLastHarvested","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"shouldHarvest","type":"bool"}],"name":"unstakeTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newSupply","type":"uint256"}],"name":"updateSupply","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526005805460ff191690553480156200001b57600080fd5b50604051620027c9380380620027c98339810160408190526200003e9162000429565b89518a908a9062000057906003906020850190620002a2565b5080516200006d906004906020840190620002a2565b505050600084118015620000815750878411155b620000f95760405162461bcd60e51b815260206004820152603960248201527f70657220626c6f636b20616d6f756e74206d757374206265206d6f726520746860448201527f616e203020616e64206c657373207468616e20737570706c790000000000000060648201526084015b60405180910390fd5b4283118062000106575082155b6200015f5760405162461bcd60e51b815260206004820152602260248201527f6c6f636b65642074696d65206d757374206265206166746572206e6f77206f72604482015261020360f41b6064820152608401620000f0565b60058054610100600160a81b0319166101006001600160a01b038a16021790558015620001a757600780546001600160a01b0319166001600160a01b038816179055620001c3565b600680546001600160a01b0319166001600160a01b0388161790555b6040805161018081018252338082526001600160a01b0397909716602082018190529181018a9052606081018a905260006080820181905260a0820181905260c0820187905260e0820186905243610100830181905261012083018290526101408301869052931515610160909201829052600880546001600160a01b0319908116909917905560098054909816909217909655600a899055600b98909855600c889055600d889055600e93909355600f9190915560109190915560119490945560129390935550506013805460ff1916909117905550620005569050565b828054620002b09062000503565b90600052602060002090601f016020900481019282620002d457600085556200031f565b82601f10620002ef57805160ff19168380011785556200031f565b828001600101855582156200031f579182015b828111156200031f57825182559160200191906001019062000302565b506200032d92915062000331565b5090565b5b808211156200032d576000815560010162000332565b80516001600160a01b03811681146200036057600080fd5b919050565b805180151581146200036057600080fd5b600082601f83011262000387578081fd5b81516001600160401b0380821115620003a457620003a462000540565b604051601f8301601f19908116603f01168101908282118183101715620003cf57620003cf62000540565b81604052838152602092508683858801011115620003eb578485fd5b8491505b838210156200040e5785820183015181830184015290820190620003ef565b838211156200041f57848385830101525b9695505050505050565b6000806000806000806000806000806101408b8d03121562000449578586fd5b8a516001600160401b038082111562000460578788fd5b6200046e8e838f0162000376565b9b5060208d015191508082111562000484578788fd5b50620004938d828e0162000376565b99505060408b01519750620004ab60608c0162000348565b9650620004bb60808c0162000348565b9550620004cb60a08c0162000348565b945060c08b0151935060e08b015192506101008b01519150620004f26101208c0162000365565b90509295989b9194979a5092959850565b600181811c908216806200051857607f821691505b602082108114156200053a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b61226380620005666000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c806395d89b41116100de578063cadc6c5911610097578063e85c77bb11610071578063e85c77bb14610431578063e93793f614610439578063fd7db8541461044f578063ff333a761461046257600080fd5b8063cadc6c59146103e8578063dd62ed3e146103f0578063e17c0f111461042957600080fd5b806395d89b411461037557806396e231e91461037d578063a3e676101461038a578063a457c2d7146103af578063a9059cbb146103c2578063b7f1ef1e146103d557600080fd5b8063313ce5671161014b5780636bd08049116101255780636bd08049146102f057806370a08231146103055780637589cf2f146103185780639168ae721461032057600080fd5b8063313ce567146102bb57806339509351146102ca5780634afcb537146102dd57600080fd5b806306fdde0314610193578063095ea7b3146101b157806309cd3a2c146101d457806316f0115b146101f557806318160ddd146102a057806323b872dd146102a8575b600080fd5b61019b61046a565b6040516101a891906120b6565b60405180910390f35b6101c46101bf366004611f06565b6104fc565b60405190151581526020016101a8565b6101e76101e2366004611e7f565b610512565b6040519081526020016101a8565b600854600954600a54600b54600c54600d54600e54600f5460105460115460125460135461023a9b6001600160a01b039081169b169998979695949392919060ff168c565b604080516001600160a01b039d8e1681529c909b1660208d0152998b019890985260608a0196909652608089019490945260a088019290925260c087015260e08601526101008501526101208401526101408301521515610160820152610180016101a8565b6002546101e7565b6101c46102b6366004611ecb565b6105d6565b604051601281526020016101a8565b6101c46102d8366004611f06565b610680565b6101e76102eb366004611e7f565b6106bc565b6103036102fe366004611f4b565b61085c565b005b6101e7610313366004611e7f565b6108d4565b6103036108ef565b61035561032e366004611e7f565b60146020526000908152604090208054600182015460028301546003909301549192909184565b6040805194855260208501939093529183015260608201526080016101a8565b61019b610c0f565b6005546101c49060ff1681565b6009546001600160a01b03165b6040516001600160a01b0390911681526020016101a8565b6101c46103bd366004611f06565b610c1e565b6101c46103d0366004611f06565b610cb7565b6103036103e3366004611f7b565b610cc4565b600f546101e7565b6101e76103fe366004611e99565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101e7611140565b61030361117c565b60055461010090046001600160a01b0316610397565b61030361045d366004612047565b6112c6565b610397611704565b606060038054610479906121c6565b80601f01602080910402602001604051908101604052809291908181526020018280546104a5906121c6565b80156104f25780601f106104c7576101008083540402835291602001916104f2565b820191906000526020600020905b8154815290600101906020018083116104d557829003601f168201915b5050505050905090565b6000610509338484611731565b50600192915050565b6008546000906001600160a01b03163314806105365750336001600160a01b038316145b6105bf5760405162461bcd60e51b815260206004820152604960248201527f63616e206f6e6c79206861727665737420746f6b656e7320666f7220736f6d6560448201527f6f6e6520656c73652069662074686973207761732074686520636f6e747261636064820152683a1031b932b0ba37b960b91b608482015260a4015b60405180910390fd5b6105c7611855565b6105d0826118ed565b92915050565b60006105e3848484611a9c565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156106685760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016105b6565b6106758533858403611731565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105099185906106b790869061212c565b611731565b6001600160a01b0381166000908152601460209081526040808320815160a08101835281548152600182015481850152600282015481840152600382015460608201526004820180548451818702810187019095528085528695929460808601939092919083018282801561075057602002820191906000526020600020905b81548152602001906001019080831161073c575b505050505081525050905043816040015110158061076d57508051155b806107785750600c54155b156107865750600092915050565b6011546010544311801561079b5750600c5415155b156108205760006107aa611140565b905060008143106107bb57816107bd565b435b6010549091506000906107d1908390611c6c565b600e549091506000906107e5908390611c7f565b600c54909150610819906108129061080c846ec097ce7bc90715b34b9f1000000000611c7f565b90611c8b565b8690611c97565b9450505050505b610854826060015161084e6ec097ce7bc90715b34b9f100000000061080c856108488a6108d4565b90611c7f565b90611c6c565b949350505050565b6008546001600160a01b031633146108ca5760405162461bcd60e51b815260206004820152602b60248201527f6f6e6c7920636f6e74726163742063726561746f722063616e2075706461746560448201526a2074686520737570706c7960a81b60648201526084016105b6565b600a819055600b55565b6001600160a01b031660009081526020819052604090205490565b336000908152601460209081526040808320815160a081018352815481526001820154818501526002820154818401526003820154606082015260048201805484518187028101870190955280855291949293608086019390929083018282801561097957602002820191906000526020600020905b815481526020019060010190808311610965575b5050505050815250509050600061098f336108d4565b9050600081116109ff5760405162461bcd60e51b815260206004820152603560248201527f757365722063616e206f6e6c7920756e7374616b6520696620746865792068616044820152741d99481d1bdad95b9cc81a5b881d1a19481c1bdbdb605a1b60648201526084016105b6565b610a0b61dead82610cb7565b5060135460ff1615610ad75760005b826080015151811015610ad157600754608084015180516001600160a01b03909216916323b872dd91309133919086908110610a6657634e487b7160e01b600052603260045260246000fd5b60200260200101516040518463ffffffff1660e01b8152600401610a8c93929190612092565b600060405180830381600087803b158015610aa657600080fd5b505af1158015610aba573d6000803e3d6000fd5b505050508080610ac990612201565b915050610a1a565b50610b77565b60065460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b158015610b2357600080fd5b505af1158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190611f2f565b610b775760405162461bcd60e51b81526004016105b6906120e9565b33600090815260146020526040812081815560018101829055600281018290556003810182905590610bac6004830182611e29565b5050610bd6816040518060400160405280600681526020016572656d6f766560d01b815250611ca3565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a25050565b606060048054610479906121c6565b3360009081526001602090815260408083206001600160a01b038616845290915281205482811015610ca05760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016105b6565b610cad3385858403611731565b5060019392505050565b6000610509338484611a9c565b43610ccd611140565b11610d385760405162461bcd60e51b815260206004820152603560248201527f74686973206661726d206973206578706972656420616e64206e6f206d6f7265604482015274081cdd185ad95c9cc818d85b881899481859191959605a1b60648201526084016105b6565b610d40611855565b6000610d4b336108d4565b1115610d5c57610d5a336118ed565b505b60135460009060ff1615610e8f576000825111610dd45760405162461bcd60e51b815260206004820152603060248201527f796f75206e65656420746f2070726f76696465204e465420746f6b656e20494460448201526f7320796f75277265207374616b696e6760801b60648201526084016105b6565b60005b8251811015610e865760075483516001600160a01b03909116906323b872dd9033903090879086908110610e1b57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518463ffffffff1660e01b8152600401610e4193929190612092565b600060405180830381600087803b158015610e5b57600080fd5b505af1158015610e6f573d6000803e3d6000fd5b505050508080610e7e90612201565b915050610dd7565b50508051611018565b6006546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610ed357600080fd5b505afa158015610ee7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0b9190611f63565b6006546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90610f4090339030908990600401612092565b602060405180830381600087803b158015610f5a57600080fd5b505af1158015610f6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f929190611f2f565b506006546040516370a0823160e01b81523060048201526110149183916001600160a01b03909116906370a082319060240160206040518083038186803b158015610fdc57600080fd5b505afa158015610ff0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084e9190611f63565b9150505b6002546110295743600d8190556010555b6110333382611cf1565b3360008181526014602052604090204380825542600183015560028201556011549091611079916ec097ce7bc90715b34b9f10000000009161080c9190610848906108d4565b600382015560005b83518110156110df57816004018482815181106110ae57634e487b7160e01b600052603260045260246000fd5b60209081029190910181015182546001810184556000938452919092200155806110d781612201565b915050611081565b50611105826040518060400160405280600381526020016218591960ea1b815250611ca3565b60405182815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a250505050565b600d5460009081901561115557600d54611157565b435b600e54600a549192506111769183916111709190611c8b565b90611c97565b91505090565b6008546001600160a01b031633148061119f57506009546001600160a01b031633145b6112205760405162461bcd60e51b815260206004820152604660248201527f63616c6c6572206d7573742062652074686520636f6e7472616374206372656160448201527f746f72206f72206f776e657220746f2072656d6f7665207374616b61626c6520606482015265746f6b656e7360d01b608482015260a4016105b6565b600554600954600b5460405163a9059cbb60e01b81526001600160a01b0392831660048201526024810191909152610100909204169063a9059cbb90604401602060405180830381600087803b15801561127957600080fd5b505af115801561128d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b19190611f2f565b506000600b556005805460ff19166001179055565b336000908152601460209081526040808320815160a081018352815481526001820154818501526002820154818401526003820154606082015260048201805484518187028101870190955280855291949293608086019390929083018282801561135057602002820191906000526020600020905b81548152602001906001019080831161133c575b50505050508152505090506000611366336108d4565b60135490915060ff1661137c578084111561137f565b60015b6113f15760405162461bcd60e51b815260206004820152603f60248201527f757365722063616e206f6e6c7920756e7374616b6520616d6f756e742074686560448201527f7920686176652063757272656e746c79207374616b6564206f72206c6573730060648201526084016105b6565b82158061140e5750601254602083015161140a91611c97565b4210155b8061141b575060055460ff165b8061142c5750611429611140565b43115b6114b05760405162461bcd60e51b815260206004820152604960248201527f796f752068617665206e6f74207374616b656420666f72206d696e696d756d2060448201527f74696d65206c6f636b2079657420616e642074686520706f6f6c206973206e6f6064820152681d08195e1c1a5c995960ba1b608482015260a4016105b6565b6114b8611855565b82156114c9576114c7336118ed565b505b60135460009060ff166114dc57846114de565b815b90506114ec61dead82610cb7565b5060135460ff16156115b85760005b8360800151518110156115b257600754608085015180516001600160a01b03909216916323b872dd9130913391908690811061154757634e487b7160e01b600052603260045260246000fd5b60200260200101516040518463ffffffff1660e01b815260040161156d93929190612092565b600060405180830381600087803b15801561158757600080fd5b505af115801561159b573d6000803e3d6000fd5b5050505080806115aa90612201565b9150506114fb565b50611658565b60065460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b15801561160457600080fd5b505af1158015611618573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163c9190611f2f565b6116585760405162461bcd60e51b81526004016105b6906120e9565b6000611663336108d4565b116116a0573360009081526014602052604081208181556001810182905560028101829055600381018290559061169d6004830182611e29565b50505b6116c8816040518060400160405280600681526020016572656d6f766560d01b815250611ca3565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a25050505050565b60135460009060ff1661172157506006546001600160a01b031690565b506007546001600160a01b031690565b6001600160a01b0383166117935760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105b6565b6001600160a01b0382166117f45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105b6565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061185f611140565b905060008143106118705781611872565b435b6010549091508111611882575050565b600c5480611891575060105550565b6010546000906118a2908490611c6c565b600e549091506000906118b6908390611c7f565b90506118e16118d88461080c846ec097ce7bc90715b34b9f1000000000611c7f565b60115490611c97565b60115550505060105550565b6001600160a01b038116600090815260146020526040812080546119535760405162461bcd60e51b815260206004820152601c60248201527f75736572206d757374206861766520746f6b656e73207374616b65640000000060448201526064016105b6565b600061195e846106bc565b90508015611a625760055460405163a9059cbb60e01b81526001600160a01b038681166004830152602482018490526101009092049091169063a9059cbb90604401602060405180830381600087803b1580156119ba57600080fd5b505af11580156119ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f29190611f2f565b611a515760405162461bcd60e51b815260206004820152602a60248201527f756e61626c6520746f2073656e6420757365722074686569722068617276657360448201526974656420746f6b656e7360b01b60648201526084016105b6565b600b54611a5e9082611c6c565b600b555b611a876ec097ce7bc90715b34b9f100000000061080c600860090154610848886108d4565b60038301554360029092019190915592915050565b6001600160a01b038316611b005760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105b6565b6001600160a01b038216611b625760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105b6565b6001600160a01b03831660009081526020819052604090205481811015611bda5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105b6565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290611c1190849061212c565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611c5d91815260200190565b60405180910390a35b50505050565b6000611c788284612183565b9392505050565b6000611c788284612164565b6000611c788284612144565b6000611c78828461212c565b611ccb816040518060400160405280600681526020016572656d6f766560d01b815250611dd0565b15611ce457600c54611cdd9083611c6c565b600c555050565b600c54611cdd9083611c97565b6001600160a01b038216611d475760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105b6565b8060026000828254611d59919061212c565b90915550506001600160a01b03821660009081526020819052604081208054839290611d8690849061212c565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600081604051602001611de39190612076565b6040516020818303038152906040528051906020012083604051602001611e0a9190612076565b6040516020818303038152906040528051906020012014905092915050565b5080546000825590600052602060002090810190611e479190611e4a565b50565b5b80821115611e5f5760008155600101611e4b565b5090565b80356001600160a01b0381168114611e7a57600080fd5b919050565b600060208284031215611e90578081fd5b611c7882611e63565b60008060408385031215611eab578081fd5b611eb483611e63565b9150611ec260208401611e63565b90509250929050565b600080600060608486031215611edf578081fd5b611ee884611e63565b9250611ef660208501611e63565b9150604084013590509250925092565b60008060408385031215611f18578182fd5b611f2183611e63565b946020939093013593505050565b600060208284031215611f40578081fd5b8151611c7881612248565b600060208284031215611f5c578081fd5b5035919050565b600060208284031215611f74578081fd5b5051919050565b60008060408385031215611f8d578182fd5b8235915060208084013567ffffffffffffffff80821115611fac578384fd5b818601915086601f830112611fbf578384fd5b813581811115611fd157611fd1612232565b8060051b604051601f19603f83011681018181108582111715611ff657611ff6612232565b604052828152858101935084860182860187018b1015612014578788fd5b8795505b83861015612036578035855260019590950194938601938601612018565b508096505050505050509250929050565b60008060408385031215612059578182fd5b82359150602083013561206b81612248565b809150509250929050565b6000825161208881846020870161219a565b9190910192915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208152600082518060208401526120d581604085016020870161219a565b601f01601f19169190910160400192915050565b60208082526023908201527f756e61626c6520746f2073656e642075736572206f726967696e616c20746f6b604082015262656e7360e81b606082015260800190565b6000821982111561213f5761213f61221c565b500190565b60008261215f57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561217e5761217e61221c565b500290565b6000828210156121955761219561221c565b500390565b60005b838110156121b557818101518382015260200161219d565b83811115611c665750506000910152565b600181811c908216806121da57607f821691505b602082108114156121fb57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156122155761221561221c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114611e4757600080fdfea164736f6c6343000804000a000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000043f11c02439e2736800433b4594994bd43cd066d000000000000000000000000492e71fa9f56d558f30388c20779e13e7a13e0da000000000000000000000000f5a1882e7ada24d959db8587b4185681d098eabf00000000000000000000000000000000000000000000000000002978fe0ee366000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000001a4d6f6f6e746f677261706879205374616b696e6720546f6b656e0000000000000000000000000000000000000000000000000000000000000000000000000005734d544759000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061018e5760003560e01c806395d89b41116100de578063cadc6c5911610097578063e85c77bb11610071578063e85c77bb14610431578063e93793f614610439578063fd7db8541461044f578063ff333a761461046257600080fd5b8063cadc6c59146103e8578063dd62ed3e146103f0578063e17c0f111461042957600080fd5b806395d89b411461037557806396e231e91461037d578063a3e676101461038a578063a457c2d7146103af578063a9059cbb146103c2578063b7f1ef1e146103d557600080fd5b8063313ce5671161014b5780636bd08049116101255780636bd08049146102f057806370a08231146103055780637589cf2f146103185780639168ae721461032057600080fd5b8063313ce567146102bb57806339509351146102ca5780634afcb537146102dd57600080fd5b806306fdde0314610193578063095ea7b3146101b157806309cd3a2c146101d457806316f0115b146101f557806318160ddd146102a057806323b872dd146102a8575b600080fd5b61019b61046a565b6040516101a891906120b6565b60405180910390f35b6101c46101bf366004611f06565b6104fc565b60405190151581526020016101a8565b6101e76101e2366004611e7f565b610512565b6040519081526020016101a8565b600854600954600a54600b54600c54600d54600e54600f5460105460115460125460135461023a9b6001600160a01b039081169b169998979695949392919060ff168c565b604080516001600160a01b039d8e1681529c909b1660208d0152998b019890985260608a0196909652608089019490945260a088019290925260c087015260e08601526101008501526101208401526101408301521515610160820152610180016101a8565b6002546101e7565b6101c46102b6366004611ecb565b6105d6565b604051601281526020016101a8565b6101c46102d8366004611f06565b610680565b6101e76102eb366004611e7f565b6106bc565b6103036102fe366004611f4b565b61085c565b005b6101e7610313366004611e7f565b6108d4565b6103036108ef565b61035561032e366004611e7f565b60146020526000908152604090208054600182015460028301546003909301549192909184565b6040805194855260208501939093529183015260608201526080016101a8565b61019b610c0f565b6005546101c49060ff1681565b6009546001600160a01b03165b6040516001600160a01b0390911681526020016101a8565b6101c46103bd366004611f06565b610c1e565b6101c46103d0366004611f06565b610cb7565b6103036103e3366004611f7b565b610cc4565b600f546101e7565b6101e76103fe366004611e99565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101e7611140565b61030361117c565b60055461010090046001600160a01b0316610397565b61030361045d366004612047565b6112c6565b610397611704565b606060038054610479906121c6565b80601f01602080910402602001604051908101604052809291908181526020018280546104a5906121c6565b80156104f25780601f106104c7576101008083540402835291602001916104f2565b820191906000526020600020905b8154815290600101906020018083116104d557829003601f168201915b5050505050905090565b6000610509338484611731565b50600192915050565b6008546000906001600160a01b03163314806105365750336001600160a01b038316145b6105bf5760405162461bcd60e51b815260206004820152604960248201527f63616e206f6e6c79206861727665737420746f6b656e7320666f7220736f6d6560448201527f6f6e6520656c73652069662074686973207761732074686520636f6e747261636064820152683a1031b932b0ba37b960b91b608482015260a4015b60405180910390fd5b6105c7611855565b6105d0826118ed565b92915050565b60006105e3848484611a9c565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156106685760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016105b6565b6106758533858403611731565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105099185906106b790869061212c565b611731565b6001600160a01b0381166000908152601460209081526040808320815160a08101835281548152600182015481850152600282015481840152600382015460608201526004820180548451818702810187019095528085528695929460808601939092919083018282801561075057602002820191906000526020600020905b81548152602001906001019080831161073c575b505050505081525050905043816040015110158061076d57508051155b806107785750600c54155b156107865750600092915050565b6011546010544311801561079b5750600c5415155b156108205760006107aa611140565b905060008143106107bb57816107bd565b435b6010549091506000906107d1908390611c6c565b600e549091506000906107e5908390611c7f565b600c54909150610819906108129061080c846ec097ce7bc90715b34b9f1000000000611c7f565b90611c8b565b8690611c97565b9450505050505b610854826060015161084e6ec097ce7bc90715b34b9f100000000061080c856108488a6108d4565b90611c7f565b90611c6c565b949350505050565b6008546001600160a01b031633146108ca5760405162461bcd60e51b815260206004820152602b60248201527f6f6e6c7920636f6e74726163742063726561746f722063616e2075706461746560448201526a2074686520737570706c7960a81b60648201526084016105b6565b600a819055600b55565b6001600160a01b031660009081526020819052604090205490565b336000908152601460209081526040808320815160a081018352815481526001820154818501526002820154818401526003820154606082015260048201805484518187028101870190955280855291949293608086019390929083018282801561097957602002820191906000526020600020905b815481526020019060010190808311610965575b5050505050815250509050600061098f336108d4565b9050600081116109ff5760405162461bcd60e51b815260206004820152603560248201527f757365722063616e206f6e6c7920756e7374616b6520696620746865792068616044820152741d99481d1bdad95b9cc81a5b881d1a19481c1bdbdb605a1b60648201526084016105b6565b610a0b61dead82610cb7565b5060135460ff1615610ad75760005b826080015151811015610ad157600754608084015180516001600160a01b03909216916323b872dd91309133919086908110610a6657634e487b7160e01b600052603260045260246000fd5b60200260200101516040518463ffffffff1660e01b8152600401610a8c93929190612092565b600060405180830381600087803b158015610aa657600080fd5b505af1158015610aba573d6000803e3d6000fd5b505050508080610ac990612201565b915050610a1a565b50610b77565b60065460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b158015610b2357600080fd5b505af1158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190611f2f565b610b775760405162461bcd60e51b81526004016105b6906120e9565b33600090815260146020526040812081815560018101829055600281018290556003810182905590610bac6004830182611e29565b5050610bd6816040518060400160405280600681526020016572656d6f766560d01b815250611ca3565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a25050565b606060048054610479906121c6565b3360009081526001602090815260408083206001600160a01b038616845290915281205482811015610ca05760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016105b6565b610cad3385858403611731565b5060019392505050565b6000610509338484611a9c565b43610ccd611140565b11610d385760405162461bcd60e51b815260206004820152603560248201527f74686973206661726d206973206578706972656420616e64206e6f206d6f7265604482015274081cdd185ad95c9cc818d85b881899481859191959605a1b60648201526084016105b6565b610d40611855565b6000610d4b336108d4565b1115610d5c57610d5a336118ed565b505b60135460009060ff1615610e8f576000825111610dd45760405162461bcd60e51b815260206004820152603060248201527f796f75206e65656420746f2070726f76696465204e465420746f6b656e20494460448201526f7320796f75277265207374616b696e6760801b60648201526084016105b6565b60005b8251811015610e865760075483516001600160a01b03909116906323b872dd9033903090879086908110610e1b57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518463ffffffff1660e01b8152600401610e4193929190612092565b600060405180830381600087803b158015610e5b57600080fd5b505af1158015610e6f573d6000803e3d6000fd5b505050508080610e7e90612201565b915050610dd7565b50508051611018565b6006546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610ed357600080fd5b505afa158015610ee7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0b9190611f63565b6006546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90610f4090339030908990600401612092565b602060405180830381600087803b158015610f5a57600080fd5b505af1158015610f6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f929190611f2f565b506006546040516370a0823160e01b81523060048201526110149183916001600160a01b03909116906370a082319060240160206040518083038186803b158015610fdc57600080fd5b505afa158015610ff0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084e9190611f63565b9150505b6002546110295743600d8190556010555b6110333382611cf1565b3360008181526014602052604090204380825542600183015560028201556011549091611079916ec097ce7bc90715b34b9f10000000009161080c9190610848906108d4565b600382015560005b83518110156110df57816004018482815181106110ae57634e487b7160e01b600052603260045260246000fd5b60209081029190910181015182546001810184556000938452919092200155806110d781612201565b915050611081565b50611105826040518060400160405280600381526020016218591960ea1b815250611ca3565b60405182815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a250505050565b600d5460009081901561115557600d54611157565b435b600e54600a549192506111769183916111709190611c8b565b90611c97565b91505090565b6008546001600160a01b031633148061119f57506009546001600160a01b031633145b6112205760405162461bcd60e51b815260206004820152604660248201527f63616c6c6572206d7573742062652074686520636f6e7472616374206372656160448201527f746f72206f72206f776e657220746f2072656d6f7665207374616b61626c6520606482015265746f6b656e7360d01b608482015260a4016105b6565b600554600954600b5460405163a9059cbb60e01b81526001600160a01b0392831660048201526024810191909152610100909204169063a9059cbb90604401602060405180830381600087803b15801561127957600080fd5b505af115801561128d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b19190611f2f565b506000600b556005805460ff19166001179055565b336000908152601460209081526040808320815160a081018352815481526001820154818501526002820154818401526003820154606082015260048201805484518187028101870190955280855291949293608086019390929083018282801561135057602002820191906000526020600020905b81548152602001906001019080831161133c575b50505050508152505090506000611366336108d4565b60135490915060ff1661137c578084111561137f565b60015b6113f15760405162461bcd60e51b815260206004820152603f60248201527f757365722063616e206f6e6c7920756e7374616b6520616d6f756e742074686560448201527f7920686176652063757272656e746c79207374616b6564206f72206c6573730060648201526084016105b6565b82158061140e5750601254602083015161140a91611c97565b4210155b8061141b575060055460ff165b8061142c5750611429611140565b43115b6114b05760405162461bcd60e51b815260206004820152604960248201527f796f752068617665206e6f74207374616b656420666f72206d696e696d756d2060448201527f74696d65206c6f636b2079657420616e642074686520706f6f6c206973206e6f6064820152681d08195e1c1a5c995960ba1b608482015260a4016105b6565b6114b8611855565b82156114c9576114c7336118ed565b505b60135460009060ff166114dc57846114de565b815b90506114ec61dead82610cb7565b5060135460ff16156115b85760005b8360800151518110156115b257600754608085015180516001600160a01b03909216916323b872dd9130913391908690811061154757634e487b7160e01b600052603260045260246000fd5b60200260200101516040518463ffffffff1660e01b815260040161156d93929190612092565b600060405180830381600087803b15801561158757600080fd5b505af115801561159b573d6000803e3d6000fd5b5050505080806115aa90612201565b9150506114fb565b50611658565b60065460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b15801561160457600080fd5b505af1158015611618573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163c9190611f2f565b6116585760405162461bcd60e51b81526004016105b6906120e9565b6000611663336108d4565b116116a0573360009081526014602052604081208181556001810182905560028101829055600381018290559061169d6004830182611e29565b50505b6116c8816040518060400160405280600681526020016572656d6f766560d01b815250611ca3565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a25050505050565b60135460009060ff1661172157506006546001600160a01b031690565b506007546001600160a01b031690565b6001600160a01b0383166117935760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105b6565b6001600160a01b0382166117f45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105b6565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061185f611140565b905060008143106118705781611872565b435b6010549091508111611882575050565b600c5480611891575060105550565b6010546000906118a2908490611c6c565b600e549091506000906118b6908390611c7f565b90506118e16118d88461080c846ec097ce7bc90715b34b9f1000000000611c7f565b60115490611c97565b60115550505060105550565b6001600160a01b038116600090815260146020526040812080546119535760405162461bcd60e51b815260206004820152601c60248201527f75736572206d757374206861766520746f6b656e73207374616b65640000000060448201526064016105b6565b600061195e846106bc565b90508015611a625760055460405163a9059cbb60e01b81526001600160a01b038681166004830152602482018490526101009092049091169063a9059cbb90604401602060405180830381600087803b1580156119ba57600080fd5b505af11580156119ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f29190611f2f565b611a515760405162461bcd60e51b815260206004820152602a60248201527f756e61626c6520746f2073656e6420757365722074686569722068617276657360448201526974656420746f6b656e7360b01b60648201526084016105b6565b600b54611a5e9082611c6c565b600b555b611a876ec097ce7bc90715b34b9f100000000061080c600860090154610848886108d4565b60038301554360029092019190915592915050565b6001600160a01b038316611b005760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105b6565b6001600160a01b038216611b625760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105b6565b6001600160a01b03831660009081526020819052604090205481811015611bda5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105b6565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290611c1190849061212c565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611c5d91815260200190565b60405180910390a35b50505050565b6000611c788284612183565b9392505050565b6000611c788284612164565b6000611c788284612144565b6000611c78828461212c565b611ccb816040518060400160405280600681526020016572656d6f766560d01b815250611dd0565b15611ce457600c54611cdd9083611c6c565b600c555050565b600c54611cdd9083611c97565b6001600160a01b038216611d475760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105b6565b8060026000828254611d59919061212c565b90915550506001600160a01b03821660009081526020819052604081208054839290611d8690849061212c565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600081604051602001611de39190612076565b6040516020818303038152906040528051906020012083604051602001611e0a9190612076565b6040516020818303038152906040528051906020012014905092915050565b5080546000825590600052602060002090810190611e479190611e4a565b50565b5b80821115611e5f5760008155600101611e4b565b5090565b80356001600160a01b0381168114611e7a57600080fd5b919050565b600060208284031215611e90578081fd5b611c7882611e63565b60008060408385031215611eab578081fd5b611eb483611e63565b9150611ec260208401611e63565b90509250929050565b600080600060608486031215611edf578081fd5b611ee884611e63565b9250611ef660208501611e63565b9150604084013590509250925092565b60008060408385031215611f18578182fd5b611f2183611e63565b946020939093013593505050565b600060208284031215611f40578081fd5b8151611c7881612248565b600060208284031215611f5c578081fd5b5035919050565b600060208284031215611f74578081fd5b5051919050565b60008060408385031215611f8d578182fd5b8235915060208084013567ffffffffffffffff80821115611fac578384fd5b818601915086601f830112611fbf578384fd5b813581811115611fd157611fd1612232565b8060051b604051601f19603f83011681018181108582111715611ff657611ff6612232565b604052828152858101935084860182860187018b1015612014578788fd5b8795505b83861015612036578035855260019590950194938601938601612018565b508096505050505050509250929050565b60008060408385031215612059578182fd5b82359150602083013561206b81612248565b809150509250929050565b6000825161208881846020870161219a565b9190910192915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208152600082518060208401526120d581604085016020870161219a565b601f01601f19169190910160400192915050565b60208082526023908201527f756e61626c6520746f2073656e642075736572206f726967696e616c20746f6b604082015262656e7360e81b606082015260800190565b6000821982111561213f5761213f61221c565b500190565b60008261215f57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561217e5761217e61221c565b500290565b6000828210156121955761219561221c565b500390565b60005b838110156121b557818101518382015260200161219d565b83811115611c665750506000910152565b600181811c908216806121da57607f821691505b602082108114156121fb57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156122155761221561221c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114611e4757600080fdfea164736f6c6343000804000a

Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.