ETH Price: $3,231.85 (+3.81%)
Gas: 37 Gwei

Contract

0xC7ddD330A9aE4870d4100363846fE84b40d01e37
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Buy It Now191771572024-02-07 15:17:5919 days 15 hrs ago1707319079IN
Yieldification: NFT Marketplace
0.95 ETH0.0119694644.60509019
Add Buy It Now C...191770822024-02-07 15:02:5919 days 15 hrs ago1707318179IN
Yieldification: NFT Marketplace
0 ETH0.0058822448.37328983
Remove Buy It No...191109272024-01-29 8:15:1128 days 22 hrs ago1706516111IN
Yieldification: NFT Marketplace
0 ETH0.00039589.53156285
Accept Offer190922192024-01-26 17:18:5931 days 13 hrs ago1706289539IN
Yieldification: NFT Marketplace
0 ETH0.0096432527.40213889
Add Offer190916502024-01-26 15:23:4731 days 15 hrs ago1706282627IN
Yieldification: NFT Marketplace
9.001 ETH0.0074947228.0502754
Remove Buy It No...190912292024-01-26 13:59:1131 days 16 hrs ago1706277551IN
Yieldification: NFT Marketplace
0 ETH0.0008493120.86970529
Remove Buy It No...190912212024-01-26 13:57:3531 days 16 hrs ago1706277455IN
Yieldification: NFT Marketplace
0 ETH0.000942422.69933301
Add Buy It Now C...190880262024-01-26 3:12:5932 days 3 hrs ago1706238779IN
Yieldification: NFT Marketplace
0 ETH0.0009346220.86159289
Add Buy It Now C...190866392024-01-25 22:34:2332 days 8 hrs ago1706222063IN
Yieldification: NFT Marketplace
0 ETH0.0009797321.86870333
Add Buy It Now C...190783382024-01-24 18:39:1133 days 12 hrs ago1706121551IN
Yieldification: NFT Marketplace
0 ETH0.00067515.0667338
Add Buy It Now C...190400992024-01-19 9:46:3538 days 21 hrs ago1705657595IN
Yieldification: NFT Marketplace
0 ETH0.0029186824
Add Buy It Now C...190259882024-01-17 10:23:3540 days 20 hrs ago1705487015IN
Yieldification: NFT Marketplace
0 ETH0.0039197732.2318313
Add Buy It Now C...188376662023-12-21 23:57:4767 days 6 hrs ago1703203067IN
Yieldification: NFT Marketplace
0 ETH0.0033926927.90021701
Buy It Now188366412023-12-21 20:31:3567 days 10 hrs ago1703190695IN
Yieldification: NFT Marketplace
0.51 ETH0.010695939.99935161
Add Buy It Now C...188351012023-12-21 15:21:5967 days 15 hrs ago1703172119IN
Yieldification: NFT Marketplace
0 ETH0.0026196358.4584478
Add Buy It Now C...188300592023-12-20 22:22:5968 days 8 hrs ago1703110979IN
Yieldification: NFT Marketplace
0 ETH0.0060565349.80215606
Add Buy It Now C...188169762023-12-19 2:15:2370 days 4 hrs ago1702952123IN
Yieldification: NFT Marketplace
0 ETH0.0023551952.55726164
Add Buy It Now C...188169042023-12-19 2:00:5970 days 4 hrs ago1702951259IN
Yieldification: NFT Marketplace
0 ETH0.0065951954.23141833
Buy It Now188168632023-12-19 1:52:4770 days 4 hrs ago1702950767IN
Yieldification: NFT Marketplace
7.5 ETH0.0146902153.31233346
Add Buy It Now C...188140632023-12-18 16:28:5970 days 14 hrs ago1702916939IN
Yieldification: NFT Marketplace
0 ETH0.0034689377.41094226
Remove Buy It No...188093572023-12-18 0:37:5971 days 6 hrs ago1702859879IN
Yieldification: NFT Marketplace
0 ETH0.0012428629.93637884
Add Buy It Now C...187952462023-12-16 1:02:1173 days 5 hrs ago1702688531IN
Yieldification: NFT Marketplace
0 ETH0.0049200940.45727707
Remove Buy It No...187747152023-12-13 3:56:3576 days 2 hrs ago1702439795IN
Yieldification: NFT Marketplace
0 ETH0.0018068844.38756197
Remove Buy It No...187746992023-12-13 3:53:2376 days 2 hrs ago1702439603IN
Yieldification: NFT Marketplace
0 ETH0.0020389449.10049649
Add Buy It Now C...187734862023-12-12 23:49:3576 days 7 hrs ago1702424975IN
Yieldification: NFT Marketplace
0 ETH0.0022025449.15089449
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Txn Hash Block From To Value
191771572024-02-07 15:17:5919 days 15 hrs ago1707319079
Yieldification: NFT Marketplace
0.90288 ETH
191771572024-02-07 15:17:5919 days 15 hrs ago1707319079
Yieldification: NFT Marketplace
0.00912 ETH
191771572024-02-07 15:17:5919 days 15 hrs ago1707319079
Yieldification: NFT Marketplace
0.038 ETH
190916502024-01-26 15:23:4731 days 15 hrs ago1706282627
Yieldification: NFT Marketplace
0.001 ETH
190916502024-01-26 15:23:4731 days 15 hrs ago1706282627
Yieldification: NFT Marketplace
9 ETH
188366412023-12-21 20:31:3567 days 10 hrs ago1703190695
Yieldification: NFT Marketplace
0.484704 ETH
188366412023-12-21 20:31:3567 days 10 hrs ago1703190695
Yieldification: NFT Marketplace
0.004896 ETH
188366412023-12-21 20:31:3567 days 10 hrs ago1703190695
Yieldification: NFT Marketplace
0.0204 ETH
188168632023-12-19 1:52:4770 days 4 hrs ago1702950767
Yieldification: NFT Marketplace
7.128 ETH
188168632023-12-19 1:52:4770 days 4 hrs ago1702950767
Yieldification: NFT Marketplace
0.072 ETH
188168632023-12-19 1:52:4770 days 4 hrs ago1702950767
Yieldification: NFT Marketplace
0.3 ETH
186847422023-11-30 13:33:1188 days 17 hrs ago1701351191
Yieldification: NFT Marketplace
0.9504 ETH
186847422023-11-30 13:33:1188 days 17 hrs ago1701351191
Yieldification: NFT Marketplace
0.0096 ETH
186847422023-11-30 13:33:1188 days 17 hrs ago1701351191
Yieldification: NFT Marketplace
0.04 ETH
186634702023-11-27 14:07:2391 days 16 hrs ago1701094043
Yieldification: NFT Marketplace
0.001 ETH
186634672023-11-27 14:06:4791 days 16 hrs ago1701094007
Yieldification: NFT Marketplace
0.001 ETH
186601802023-11-27 3:03:5992 days 3 hrs ago1701054239
Yieldification: NFT Marketplace
0.001 ETH
186069962023-11-19 16:18:3599 days 14 hrs ago1700410715
Yieldification: NFT Marketplace
0.001 ETH
185221572023-11-07 19:26:23111 days 11 hrs ago1699385183
Yieldification: NFT Marketplace
0.001 ETH
184637162023-10-30 14:58:11119 days 15 hrs ago1698677891
Yieldification: NFT Marketplace
0.001 ETH
184200262023-10-24 12:09:35125 days 18 hrs ago1698149375
Yieldification: NFT Marketplace
0.001 ETH
184062332023-10-22 13:47:59127 days 17 hrs ago1697982479
Yieldification: NFT Marketplace
0.001 ETH
183933262023-10-20 18:29:11129 days 12 hrs ago1697826551
Yieldification: NFT Marketplace
0.001 ETH
183913952023-10-20 11:59:59129 days 18 hrs ago1697803199
Yieldification: NFT Marketplace
0.001 ETH
183913952023-10-20 11:59:59129 days 18 hrs ago1697803199
Yieldification: NFT Marketplace
9 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NFTMarketplace

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 11 : NFTMarketplace.sol
/******************************************************************************************************
Yieldification NFT Marketplace

Website: https://yieldification.com
Twitter: https://twitter.com/yieldification
Telegram: https://t.me/yieldification
******************************************************************************************************/

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import './interfaces/IERC721Royalty.sol';
import './interfaces/IWETH.sol';

contract NFTMarketplace is Ownable {
  using SafeERC20 for IERC20;

  uint256 constant DENOMENATOR = 10000;

  bool public marketplaceEnabled = true;
  address public treasury;
  IWETH public weth;
  uint256 public addOfferFee = 1 ether / 1000; // 0.001 ETH
  uint256 public serviceFeePercent = (DENOMENATOR * 1) / 100; // 1%

  // ERC20 token => amount volume
  mapping(address => uint256) public totalVolume;
  // ERC20 token => whether it's valid
  mapping(address => bool) public validOfferERC20;
  address[] _validOfferTokens;
  mapping(address => uint256) _validOfferTokensIdx;

  struct BuyItNowConfig {
    address creator;
    address nftContract;
    uint256 tokenId;
    address erc20;
    uint256 amount;
  }
  mapping(bytes32 => BuyItNowConfig) _buyItNowConfigs;

  struct Offer {
    address owner; // person who created offer
    address nftContract;
    uint256 tokenId;
    address offerERC20;
    uint256 amount;
    uint256 timestamp;
    uint256 expiration;
  }
  // NFT ID => Offer
  mapping(bytes32 => Offer[]) _offers;

  event AddBuyItNowConfig(
    address indexed owner,
    address nftContract,
    uint256 tokenId,
    address buyItNowToken,
    uint256 buyItNowAmount
  );
  event RemoveBuyItNowConfig(
    address indexed owner,
    address nftContract,
    uint256 tokenId
  );
  event AddOffer(
    address indexed owner,
    address nftContract,
    uint256 tokenId,
    address offerToken,
    uint256 offerAmount
  );
  event RemoveOffer(
    address indexed owner,
    address nftContract,
    uint256 tokenId,
    uint256 offerIdx
  );
  event EditOffer(
    address indexed owner,
    address nftContract,
    uint256 tokenId,
    uint256 offerIdx,
    uint256 offerAmount,
    uint256 expiration
  );
  event ProcessTransaction(
    address indexed nftContract,
    uint256 tokenId,
    address oldOwner,
    address newOwner,
    address paymentToken,
    uint256 price
  );

  constructor(IWETH _weth) {
    weth = _weth;
  }

  function getAllNFTOffers(address _nftContract, uint256 _tokenId)
    public
    view
    returns (Offer[] memory)
  {
    return _offers[_getUniqueNFTID(_nftContract, _tokenId)];
  }

  function getAllOffersMultiple(
    address _nftContract,
    uint256[] memory _tokenIds
  ) external view returns (Offer[][] memory) {
    Offer[][] memory _allOffers;
    for (uint256 _i = 0; _i < _tokenIds.length; _i++) {
      _allOffers[_i] = getAllNFTOffers(_nftContract, _tokenIds[_i]);
    }
    return _allOffers;
  }

  function getAllValidOfferTokens() external view returns (address[] memory) {
    return _validOfferTokens;
  }

  function getBuyItNowConfig(address _nftContract, uint256 _tokenId)
    external
    view
    returns (BuyItNowConfig memory)
  {
    return _buyItNowConfigs[_getUniqueNFTID(_nftContract, _tokenId)];
  }

  function addBuyItNowConfig(
    address _nftContract,
    uint256 _tokenId,
    address _buyItNowToken,
    uint256 _buyItNowAmount
  ) external {
    require(
      _buyItNowToken == address(0) || validOfferERC20[_buyItNowToken],
      'invalid buy it now token'
    );

    IERC721Royalty _nft = IERC721Royalty(_nftContract);
    require(_nft.ownerOf(_tokenId) == msg.sender, 'must be NFT owner');
    _buyItNowConfigs[_getUniqueNFTID(_nftContract, _tokenId)] = BuyItNowConfig({
      creator: msg.sender,
      nftContract: _nftContract,
      tokenId: _tokenId,
      erc20: _buyItNowToken,
      amount: _buyItNowAmount
    });

    emit AddBuyItNowConfig(
      msg.sender,
      _nftContract,
      _tokenId,
      _buyItNowToken,
      _buyItNowAmount
    );
  }

  function removeBuyItNowConfig(address _nftContract, uint256 _tokenId)
    external
  {
    IERC721Royalty _nft = IERC721Royalty(_nftContract);
    require(_nft.ownerOf(_tokenId) == msg.sender, 'must be NFT owner');
    delete _buyItNowConfigs[_getUniqueNFTID(_nftContract, _tokenId)];

    emit RemoveBuyItNowConfig(msg.sender, _nftContract, _tokenId);
  }

  function buyItNow(
    address _nftContract,
    uint256 _tokenId,
    address _buyItNowToken,
    uint256 _buyItNowAmount
  ) external payable {
    require(marketplaceEnabled, 'not enabled');

    bytes32 _nftId = _getUniqueNFTID(_nftContract, _tokenId);
    BuyItNowConfig memory _binConf = _buyItNowConfigs[_nftId];
    IERC721Royalty _nft = IERC721Royalty(_nftContract);
    require(_binConf.creator == _nft.ownerOf(_tokenId), 'BIN1: bad owner');
    require(_binConf.erc20 == _buyItNowToken, 'BIN2: bad token');
    require(_binConf.amount == _buyItNowAmount, 'BIN3: bad amount');

    (address _royaltyAddress, uint256 _royaltyAmount) = _getRoyaltyInfo(
      _nftContract,
      _binConf.amount
    );
    _processPayment(
      _binConf.erc20,
      _binConf.amount,
      msg.sender,
      _binConf.creator,
      _royaltyAddress,
      _royaltyAmount
    );
    _transferNFT(_nftContract, _tokenId, _binConf.creator, msg.sender);

    emit ProcessTransaction(
      _nftContract,
      _tokenId,
      _binConf.creator,
      msg.sender,
      _binConf.erc20,
      _binConf.amount
    );
  }

  function acceptOffer(
    address _nftContract,
    uint256 _tokenId,
    uint256 _offerIdx,
    address _offerToken,
    uint256 _offerAmount
  ) external {
    require(marketplaceEnabled, 'not enabled');

    Offer memory _offer = _offers[_getUniqueNFTID(_nftContract, _tokenId)][
      _offerIdx
    ];
    IERC721Royalty _nft = IERC721Royalty(_nftContract);
    require(msg.sender == _nft.ownerOf(_tokenId), 'ACCOFF1: must be owner');
    require(_offer.offerERC20 == _offerToken, 'ACCOFF2: bad token');
    require(_offer.amount == _offerAmount, 'ACCOFF3: bad amount');
    require(
      _offer.expiration == 0 || _offer.expiration > block.timestamp,
      'ACCOFF4: expired'
    );

    (address _royaltyAddress, uint256 _royaltyAmount) = _getRoyaltyInfo(
      _nftContract,
      _offer.amount
    );
    _processPayment(
      _offer.offerERC20,
      _offer.amount,
      _offer.owner,
      msg.sender,
      _royaltyAddress,
      _royaltyAmount
    );
    _transferNFT(_nftContract, _tokenId, msg.sender, _offer.owner);
    _removeOffer(_offer.owner, _nftContract, _tokenId, _offerIdx);

    emit ProcessTransaction(
      _nftContract,
      _tokenId,
      msg.sender,
      _offer.owner,
      _offer.offerERC20,
      _offer.amount
    );
  }

  function addOffer(
    address _nftContract,
    uint256 _tokenId,
    address _offerToken,
    uint256 _offerAmount,
    uint256 expiration
  ) external payable {
    IERC721Royalty _nft = IERC721Royalty(_nftContract);
    address _finalOfferToken;
    uint256 _finalOfferAmount;

    require(_nft.ownerOf(_tokenId) != msg.sender, 'ADDOFF1: not owner');

    if (_offerToken == address(0)) {
      require(msg.value > addOfferFee, 'ADDOFF2: need ETH');
      require(validOfferERC20[address(weth)], 'ADDOFF3: WETH not valid');

      uint256 _ethOfferAmount = msg.value - addOfferFee;
      IERC20 _wethIERC20 = IERC20(address(weth));
      uint256 _wethBalBefore = _wethIERC20.balanceOf(address(this));
      weth.deposit{ value: _ethOfferAmount }();
      _wethIERC20.transfer(
        msg.sender,
        _wethIERC20.balanceOf(address(this)) - _wethBalBefore
      );

      _finalOfferToken = address(weth);
      _finalOfferAmount = (_ethOfferAmount * 10**weth.decimals()) / 10**18;
    } else {
      require(msg.value == addOfferFee, 'ADDOFF4: offer fee');
      require(validOfferERC20[_offerToken], 'ADDOFF5: invalid offer token');
      _finalOfferToken = _offerToken;
      _finalOfferAmount = _offerAmount;
    }

    if (addOfferFee > 0) {
      (bool _success, ) = payable(_getTreasury()).call{ value: addOfferFee }(
        ''
      );
      require(_success, 'ADDOFF6: add offer fee');
    }

    IERC20 _offTokenCont = IERC20(_finalOfferToken);
    require(
      _offTokenCont.balanceOf(msg.sender) >= _finalOfferAmount,
      'ADDOFF7: bad balance'
    );
    require(
      _offTokenCont.allowance(msg.sender, address(this)) >= _finalOfferAmount,
      'ADDOFF8: need allowance'
    );
    require(expiration == 0 || expiration > block.timestamp, 'bad expiration');

    _offers[_getUniqueNFTID(_nftContract, _tokenId)].push(
      Offer({
        owner: msg.sender,
        nftContract: _nftContract,
        tokenId: _tokenId,
        offerERC20: _finalOfferToken,
        amount: _finalOfferAmount,
        timestamp: block.timestamp,
        expiration: expiration
      })
    );
    emit AddOffer(
      msg.sender,
      _nftContract,
      _tokenId,
      _finalOfferToken,
      _finalOfferAmount
    );
  }

  function editOffer(
    address _nftContract,
    uint256 _tokenId,
    uint256 _offerIdx,
    uint256 _offerAmount,
    uint256 _expiration
  ) external {
    bytes32 _nftId = _getUniqueNFTID(_nftContract, _tokenId);
    Offer storage _offer = _offers[_nftId][_offerIdx];
    require(_offer.owner == msg.sender, 'must own offer to edit');

    if (_offerAmount > 0) {
      _offer.amount = _offerAmount;
    }
    if (_expiration > 0) {
      _offer.expiration = _expiration;
    }

    emit EditOffer(
      _offer.owner,
      _nftContract,
      _tokenId,
      _offerIdx,
      _offerAmount,
      _expiration
    );
  }

  function removeOffer(
    address _nftContract,
    uint256 _tokenId,
    uint256 _offerIdx
  ) external {
    _removeOffer(msg.sender, _nftContract, _tokenId, _offerIdx);
  }

  function _removeOffer(
    address _caller,
    address _nftContract,
    uint256 _tokenId,
    uint256 _offerIdx
  ) internal {
    bytes32 _nftId = _getUniqueNFTID(_nftContract, _tokenId);
    Offer memory _offer = _offers[_nftId][_offerIdx];
    IERC721Royalty _nft = IERC721Royalty(_nftContract);
    require(_offer.owner != address(0), 'offer does not exist');
    require(
      _caller == _offer.owner || _caller == _nft.ownerOf(_tokenId),
      'must be offer or NFT owner to remove'
    );
    _offers[_nftId][_offerIdx] = _offers[_nftId][_offers[_nftId].length - 1];
    _offers[_nftId].pop();

    emit RemoveOffer(_offer.owner, _nftContract, _tokenId, _offerIdx);
  }

  function _getUniqueNFTID(address _nftContract, uint256 _tokenId)
    internal
    pure
    returns (bytes32)
  {
    return keccak256(abi.encodePacked(_nftContract, _tokenId));
  }

  function _processPayment(
    address _paymentToken,
    uint256 _amount,
    address _payor,
    address _receiver,
    address _royaltyReceiver,
    uint256 _royaltyAmount
  ) internal {
    uint256 _amountAfterRoyalty = _amount;
    if (_royaltyReceiver != address(0)) {
      _amountAfterRoyalty -= _royaltyAmount;
    }
    uint256 _treasuryAmount = (_amountAfterRoyalty * serviceFeePercent) /
      DENOMENATOR;
    uint256 _receiverAmount = _amountAfterRoyalty - _treasuryAmount;
    if (_paymentToken == address(0)) {
      require(msg.value >= _amount, 'not enough ETH to pay for NFT');
      uint256 _before = address(this).balance;
      // process royalty payment
      if (_royaltyAmount > 0) {
        (bool _royaltySuccess, ) = payable(_royaltyReceiver).call{
          value: _royaltyAmount
        }('');
        require(_royaltySuccess, 'royalty payment was not processed');
      }
      // process treasury payment
      if (_treasuryAmount > 0) {
        (bool _treasSuccess, ) = payable(_getTreasury()).call{
          value: _treasuryAmount
        }('');
        require(_treasSuccess, 'treasury payment was not processed');
      }
      (bool _success, ) = payable(_receiver).call{ value: _receiverAmount }('');
      require(_success, 'main payment was not processed');
      require(address(this).balance >= _before - _amount);
    } else {
      IERC20 _paymentTokenCont = IERC20(_paymentToken);
      // process royalty payment
      if (_royaltyAmount > 0) {
        _paymentTokenCont.safeTransferFrom(
          _payor,
          _royaltyReceiver,
          _royaltyAmount
        );
      }
      if (_treasuryAmount > 0) {
        _paymentTokenCont.safeTransferFrom(
          _payor,
          _getTreasury(),
          _treasuryAmount
        );
      }
      _paymentTokenCont.safeTransferFrom(_payor, _receiver, _receiverAmount);
    }
    totalVolume[_paymentToken] += _amount;
  }

  function _transferNFT(
    address _nftContract,
    uint256 _tokenId,
    address _oldOwner,
    address _newOwner
  ) internal {
    IERC721Royalty _nft = IERC721Royalty(_nftContract);
    require(_nft.ownerOf(_tokenId) == _oldOwner, 'current owner invalid');
    _nft.safeTransferFrom(_oldOwner, _newOwner, _tokenId);

    // clean up any existing buy it now config
    bytes32 _nftId = _getUniqueNFTID(_nftContract, _tokenId);
    delete _buyItNowConfigs[_nftId];
  }

  function _getRoyaltyInfo(address _nftContract, uint256 _saleAmount)
    internal
    view
    returns (address, uint256)
  {
    IERC721Royalty _nft = IERC721Royalty(_nftContract);
    try _nft.royaltyInfo(0, _saleAmount) returns (
      address _royaltyAddress,
      uint256 _royaltyAmount
    ) {
      return (_royaltyAddress, _royaltyAmount);
    } catch {
      return (address(0), 0);
    }
  }

  function _getTreasury() internal view returns (address) {
    return treasury == address(0) ? owner() : treasury;
  }

  function updateValidOfferToken(address _token, bool _isValid)
    external
    onlyOwner
  {
    require(validOfferERC20[_token] != _isValid, 'must toggle');
    validOfferERC20[_token] = _isValid;
    if (_isValid) {
      _validOfferTokensIdx[_token] = _validOfferTokens.length;
      _validOfferTokens.push(_token);
    } else {
      uint256 _idx = _validOfferTokensIdx[_token];
      delete _validOfferTokensIdx[_token];
      _validOfferTokens[_idx] = _validOfferTokens[_validOfferTokens.length - 1];
      _validOfferTokens.pop();
    }
  }

  function setTreasury(address _treasury) external onlyOwner {
    treasury = _treasury;
  }

  function setServiceFeePercent(uint256 _percent) external onlyOwner {
    require(_percent <= (DENOMENATOR * 10) / 100, 'must be <= 10%');
    serviceFeePercent = _percent;
  }

  function setAddOfferFee(uint256 _wei) external onlyOwner {
    addOfferFee = _wei;
  }

  function setWETH(IWETH _weth) external onlyOwner {
    weth = _weth;
  }

  function setMarketplaceEnabled(bool _isEnabled) external onlyOwner {
    require(marketplaceEnabled != _isEnabled, 'must toggle enabled');
    marketplaceEnabled = _isEnabled;
  }

  function withdrawERC20(address _tokenAddress, uint256 _amount)
    external
    onlyOwner
  {
    IERC20 _contract = IERC20(_tokenAddress);
    _amount = _amount == 0 ? _contract.balanceOf(address(this)) : _amount;
    require(_amount > 0);
    _contract.safeTransfer(owner(), _amount);
  }

  function withdrawETH() external onlyOwner {
    payable(owner()).call{ value: address(this).balance }('');
  }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 4 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

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

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

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

File 5 of 11 : IERC721Royalty.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';

interface IERC721Royalty is IERC721 {
  // Support royalty info - See {EIP-2981}: https://eips.ethereum.org/EIPS/eip-2981
  function royaltyInfo(uint256, uint256 _salePrice)
    external
    view
    returns (address receiver, uint256 royaltyAmount);
}

File 6 of 11 : IWETH.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

interface IWETH {
  function decimals() external view returns (uint8);

  function deposit() external payable;

  function withdraw(uint256 wad) external;
}

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

pragma solidity ^0.8.0;

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

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

File 8 of 11 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

File 10 of 11 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: 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 Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

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

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

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface 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":"contract IWETH","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"buyItNowToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"buyItNowAmount","type":"uint256"}],"name":"AddBuyItNowConfig","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"offerToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"offerAmount","type":"uint256"}],"name":"AddOffer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"offerIdx","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"offerAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expiration","type":"uint256"}],"name":"EditOffer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"},{"indexed":false,"internalType":"address","name":"paymentToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"ProcessTransaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"RemoveBuyItNowConfig","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"offerIdx","type":"uint256"}],"name":"RemoveOffer","type":"event"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_offerIdx","type":"uint256"},{"internalType":"address","name":"_offerToken","type":"address"},{"internalType":"uint256","name":"_offerAmount","type":"uint256"}],"name":"acceptOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_buyItNowToken","type":"address"},{"internalType":"uint256","name":"_buyItNowAmount","type":"uint256"}],"name":"addBuyItNowConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_offerToken","type":"address"},{"internalType":"uint256","name":"_offerAmount","type":"uint256"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"name":"addOffer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"addOfferFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_buyItNowToken","type":"address"},{"internalType":"uint256","name":"_buyItNowAmount","type":"uint256"}],"name":"buyItNow","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_offerIdx","type":"uint256"},{"internalType":"uint256","name":"_offerAmount","type":"uint256"},{"internalType":"uint256","name":"_expiration","type":"uint256"}],"name":"editOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getAllNFTOffers","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"offerERC20","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"internalType":"struct NFTMarketplace.Offer[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"getAllOffersMultiple","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"offerERC20","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"internalType":"struct NFTMarketplace.Offer[][]","name":"","type":"tuple[][]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllValidOfferTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getBuyItNowConfig","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"erc20","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct NFTMarketplace.BuyItNowConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketplaceEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"removeBuyItNowConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_offerIdx","type":"uint256"}],"name":"removeOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"serviceFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_wei","type":"uint256"}],"name":"setAddOfferFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isEnabled","type":"bool"}],"name":"setMarketplaceEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_percent","type":"uint256"}],"name":"setServiceFeePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IWETH","name":"_weth","type":"address"}],"name":"setWETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalVolume","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_isValid","type":"bool"}],"name":"updateValidOfferToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"validOfferERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526000805460ff60a01b1916600160a01b17905566038d7ea4c680006003556064620000336127106001620000f3565b6200003f919062000121565b6004553480156200004f57600080fd5b506040516200365938038062003659833981016040819052620000729162000144565b6200007d33620000a3565b600280546001600160a01b0319166001600160a01b039290921691909117905562000176565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008160001904831182151516156200011c57634e487b7160e01b600052601160045260246000fd5b500290565b6000826200013f57634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156200015757600080fd5b81516001600160a01b03811681146200016f57600080fd5b9392505050565b6134d380620001866000396000f3fe6080604052600436106101c25760003560e01c806392f5a348116100f7578063e7f4e3f711610095578063f131262d11610064578063f131262d14610548578063f2fde38b14610575578063f752165214610595578063ffc96547146105b557600080fd5b8063e7f4e3f7146104c8578063eaeab137146104e8578063ec29c39d14610508578063f0f442601461052857600080fd5b8063ae6cb51a116100d1578063ae6cb51a14610450578063b1c87eb714610470578063e086e5ec14610486578063e62b9e6c1461049b57600080fd5b806392f5a348146103ea578063995bc51e1461040c578063a1db97821461043057600080fd5b80635b5b59fb11610164578063715018a61161013e578063715018a614610384578063737095e8146103995780638da5cb5b146103b95780639028c03f146103d757600080fd5b80635b5b59fb146103175780635b769f3c1461034457806361d027b31461036457600080fd5b8063358acabc116101a0578063358acabc1461023f5780633fc8cef3146102ac5780634016228c146102e45780635ade3c7d1461030457600080fd5b8063064851d4146101c7578063242271a6146101e9578063311020b514610209575b600080fd5b3480156101d357600080fd5b506101e76101e2366004612d8d565b6105e5565b005b3480156101f557600080fd5b506101e7610204366004612dc6565b6107ac565b34801561021557600080fd5b5060005461022a90600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004612de3565b61082a565b604051610236919081516001600160a01b03908116825260208084015182169083015260408084015190830152606080840151909116908201526080918201519181019190915260a00190565b3480156102b857600080fd5b506002546102cc906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102f057600080fd5b506101e76102ff366004612de3565b6108c8565b6101e7610312366004612e0f565b610a18565b34801561032357600080fd5b50610337610332366004612e77565b6112e6565b6040516102369190612fa0565b34801561035057600080fd5b506101e761035f36600461302f565b611350565b34801561037057600080fd5b506001546102cc906001600160a01b031681565b34801561039057600080fd5b506101e761137a565b3480156103a557600080fd5b506101e76103b436600461304c565b61138e565b3480156103c557600080fd5b506000546001600160a01b03166102cc565b6101e76103e536600461304c565b6115cd565b3480156103f657600080fd5b506103ff611883565b6040516102369190613094565b34801561041857600080fd5b5061042260045481565b604051908152602001610236565b34801561043c57600080fd5b506101e761044b366004612de3565b6118e5565b34801561045c57600080fd5b506101e761046b3660046130e1565b61199c565b34801561047c57600080fd5b5061042260035481565b34801561049257600080fd5b506101e7611ab6565b3480156104a757600080fd5b506104226104b636600461302f565b60056020526000908152604090205481565b3480156104d457600080fd5b506101e76104e3366004613125565b611b14565b3480156104f457600080fd5b506101e761050336600461313e565b611b7a565b34801561051457600080fd5b506101e7610523366004613125565b611ed6565b34801561053457600080fd5b506101e761054336600461302f565b611ee3565b34801561055457600080fd5b50610568610563366004612de3565b611f0d565b6040516102369190613190565b34801561058157600080fd5b506101e761059036600461302f565b611fd7565b3480156105a157600080fd5b506101e76105b03660046131cd565b612050565b3480156105c157600080fd5b5061022a6105d036600461302f565b60066020526000908152604090205460ff1681565b6105ed61205c565b6001600160a01b03821660009081526006602052604090205481151560ff9091161515036106505760405162461bcd60e51b815260206004820152600b60248201526a6d75737420746f67676c6560a81b60448201526064015b60405180910390fd5b6001600160a01b0382166000908152600660205260409020805460ff191682158015919091179091556106dd57600780546001600160a01b0384166000818152600860205260408120839055600183018455929092527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b03191690911790555050565b6001600160a01b038216600090815260086020526040812080549190556007805461070a90600190613218565b8154811061071a5761071a61322b565b600091825260209091200154600780546001600160a01b0390921691839081106107465761074661322b565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600780548061078557610785613241565b600082815260209020810160001990810180546001600160a01b0319169055019055505050565b6107b461205c565b801515600060149054906101000a900460ff1615150361080c5760405162461bcd60e51b81526020600482015260136024820152721b5d5cdd081d1bd9d9db1948195b98589b1959606a1b6044820152606401610647565b60008054911515600160a01b0260ff60a01b19909216919091179055565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526009600061086385856120b6565b81526020808201929092526040908101600020815160a08101835281546001600160a01b039081168252600183015481169482019490945260028201549281019290925260038101549092166060820152600490910154608082015290505b92915050565b6040516331a9108f60e11b815260048101829052829033906001600160a01b03831690636352211e90602401602060405180830381865afa158015610911573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109359190613257565b6001600160a01b03161461097f5760405162461bcd60e51b815260206004820152601160248201527036bab9ba1031329027232a1037bbb732b960791b6044820152606401610647565b6009600061098d85856120b6565b81526020808201929092526040908101600090812080546001600160a01b03199081168255600182018054821690556002820183905560038201805490911690556004015580516001600160a01b038616815291820184905233917f5c1eebe071e4c97619a6d2d556db16b1dca7e17db2a11816c681a412a05ad7fd910160405180910390a2505050565b6040516331a9108f60e11b8152600481018590528590600090819033906001600160a01b03851690636352211e90602401602060405180830381865afa158015610a66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8a9190613257565b6001600160a01b031603610ad55760405162461bcd60e51b815260206004820152601260248201527120a22227a323189d103737ba1037bbb732b960711b6044820152606401610647565b6001600160a01b038616610e10576003543411610b285760405162461bcd60e51b815260206004820152601160248201527008288889e8c8c647440dccacac8408aa89607b1b6044820152606401610647565b6002546001600160a01b031660009081526006602052604090205460ff16610b925760405162461bcd60e51b815260206004820152601760248201527f4144444f4646333a2057455448206e6f742076616c69640000000000000000006044820152606401610647565b600060035434610ba29190613218565b6002546040516370a0823160e01b81523060048201529192506001600160a01b03169060009082906370a0823190602401602060405180830381865afa158015610bf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c149190613274565b9050600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b158015610c6657600080fd5b505af1158015610c7a573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201526001600160a01b038616935063a9059cbb9250339150849084906370a0823190602401602060405180830381865afa158015610ccf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf39190613274565b610cfd9190613218565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610d48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6c919061328d565b506002546040805163313ce56760e01b815290516001600160a01b039092169650670de0b6b3a764000091879163313ce5679160048083019260209291908290030181865afa158015610dc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de791906132aa565b610df290600a6133a9565b610dfc90856133b8565b610e0691906133d7565b9350505050610ec4565b6003543414610e565760405162461bcd60e51b81526020600482015260126024820152714144444f4646343a206f666665722066656560701b6044820152606401610647565b6001600160a01b03861660009081526006602052604090205460ff16610ebe5760405162461bcd60e51b815260206004820152601c60248201527f4144444f4646353a20696e76616c6964206f6666657220746f6b656e000000006044820152606401610647565b50849050835b60035415610f73576000610ed66120fd565b6001600160a01b031660035460405160006040518083038185875af1925050503d8060008114610f22576040519150601f19603f3d011682016040523d82523d6000602084013e610f27565b606091505b5050905080610f715760405162461bcd60e51b81526020600482015260166024820152754144444f4646363a20616464206f666665722066656560501b6044820152606401610647565b505b6040516370a0823160e01b8152336004820152829082906001600160a01b038316906370a0823190602401602060405180830381865afa158015610fbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdf9190613274565b10156110245760405162461bcd60e51b81526020600482015260146024820152734144444f4646373a206261642062616c616e636560601b6044820152606401610647565b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa158015611070573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110949190613274565b10156110e25760405162461bcd60e51b815260206004820152601760248201527f4144444f4646383a206e65656420616c6c6f77616e63650000000000000000006044820152606401610647565b8415806110ee57504285115b61112b5760405162461bcd60e51b815260206004820152600e60248201526d3130b21032bc3834b930ba34b7b760911b6044820152606401610647565b600a60006111398b8b6120b6565b81526020019081526020016000206040518060e00160405280336001600160a01b031681526020018b6001600160a01b031681526020018a8152602001856001600160a01b0316815260200184815260200142815260200187815250908060018154018082558091505060019003906000526020600020906007020160009091909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506040820151816002015560608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506080820151816004015560a0820151816005015560c082015181600601555050336001600160a01b03167fb347d5698089b69dfa9b10f4c5340078eb108f1a97644fd5da65d1f1c06710d98a8a86866040516112d394939291906001600160a01b039485168152602081019390935292166040820152606081019190915260800190565b60405180910390a2505050505050505050565b60608060005b8351811015611348576113188585838151811061130b5761130b61322b565b6020026020010151611f0d565b82828151811061132a5761132a61322b565b60200260200101819052508080611340906133f9565b9150506112ec565b509392505050565b61135861205c565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b61138261205c565b61138c6000612131565b565b6001600160a01b03821615806113bc57506001600160a01b03821660009081526006602052604090205460ff165b6114085760405162461bcd60e51b815260206004820152601860248201527f696e76616c696420627579206974206e6f7720746f6b656e00000000000000006044820152606401610647565b6040516331a9108f60e11b815260048101849052849033906001600160a01b03831690636352211e90602401602060405180830381865afa158015611451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114759190613257565b6001600160a01b0316146114bf5760405162461bcd60e51b815260206004820152601160248201527036bab9ba1031329027232a1037bbb732b960791b6044820152606401610647565b6040518060a00160405280336001600160a01b03168152602001866001600160a01b03168152602001858152602001846001600160a01b03168152602001838152506009600061150f88886120b6565b81526020808201929092526040908101600020835181546001600160a01b03199081166001600160a01b039283161783558585015160018401805483169184169190911790558584015160028401556060808701516003850180549093169084161790915560809586015160049093019290925582518a8216815293840189905287168383015282018590525133927ff0f38eeaced5cad85b530a359e86a0d6349236e42f53160f8cc35155e54ac5a2928290030190a25050505050565b600054600160a01b900460ff166116145760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08195b98589b195960aa1b6044820152606401610647565b600061162085856120b6565b600081815260096020908152604091829020825160a08101845281546001600160a01b0390811682526001830154811693820193909352600282015481850152600382015483166060820152600491820154608082015292516331a9108f60e11b815290810188905292935090918791821690636352211e90602401602060405180830381865afa1580156116b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116dd9190613257565b6001600160a01b031682600001516001600160a01b0316146117335760405162461bcd60e51b815260206004820152600f60248201526e2124a7189d103130b21037bbb732b960891b6044820152606401610647565b846001600160a01b031682606001516001600160a01b03161461178a5760405162461bcd60e51b815260206004820152600f60248201526e2124a7191d103130b2103a37b5b2b760891b6044820152606401610647565b838260800151146117d05760405162461bcd60e51b815260206004820152601060248201526f1092538cce8818985908185b5bdd5b9d60821b6044820152606401610647565b6000806117e1898560800151612181565b915091506117ff846060015185608001513387600001518686612215565b61180f898986600001513361257f565b8351606085015160808601516040516001600160a01b038d16937f1b44a88f1dd177e1da6d7e446e4c19954e9fe5599273385a3fda0efb64f98a7b936112d3938e93339291909485526001600160a01b03938416602086015291831660408501529091166060830152608082015260a00190565b606060078054806020026020016040519081016040528092919081815260200182805480156118db57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116118bd575b5050505050905090565b6118ed61205c565b8181156118fa5781611962565b6040516370a0823160e01b81523060048201526001600160a01b038216906370a0823190602401602060405180830381865afa15801561193e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119629190613274565b91506000821161197157600080fd5b6119976119866000546001600160a01b031690565b6001600160a01b03831690846126f9565b505050565b60006119a886866120b6565b6000818152600a6020526040812080549293509091869081106119cd576119cd61322b565b6000918252602090912060079091020180549091506001600160a01b03163314611a325760405162461bcd60e51b81526020600482015260166024820152751b5d5cdd081bdddb881bd999995c881d1bc819591a5d60521b6044820152606401610647565b8315611a4057600481018490555b8215611a4e57600681018390555b8054604080516001600160a01b038a81168252602082018a905291810188905260608101879052608081018690529116907f3bb3926589ae1966c753c9ae5f116ca6e9114af7fc2ff28814e54970f9e2e6af9060a0015b60405180910390a250505050505050565b611abe61205c565b6000546001600160a01b03166001600160a01b03164760405160006040518083038185875af1925050503d8060008114611997576040519150601f19603f3d011682016040523d82523d6000602084013e505050565b611b1c61205c565b6064611b2b612710600a6133b8565b611b3591906133d7565b811115611b755760405162461bcd60e51b815260206004820152600e60248201526d6d757374206265203c3d2031302560901b6044820152606401610647565b600455565b600054600160a01b900460ff16611bc15760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08195b98589b195960aa1b6044820152606401610647565b6000600a6000611bd188886120b6565b81526020019081526020016000208481548110611bf057611bf061322b565b60009182526020918290206040805160e08101825260079390930290910180546001600160a01b03908116845260018201548116948401949094526002810154838301526003810154841660608401526004808201546080850152600582015460a085015260069091015460c084015290516331a9108f60e11b81529081018890529092508791821690636352211e90602401602060405180830381865afa158015611ca0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc49190613257565b6001600160a01b0316336001600160a01b031614611d1d5760405162461bcd60e51b815260206004820152601660248201527520a1a1a7a323189d1036bab9ba1031329037bbb732b960511b6044820152606401610647565b836001600160a01b031682606001516001600160a01b031614611d775760405162461bcd60e51b815260206004820152601260248201527120a1a1a7a323191d103130b2103a37b5b2b760711b6044820152606401610647565b82826080015114611dc05760405162461bcd60e51b81526020600482015260136024820152721050d0d3d1918cce8818985908185b5bdd5b9d606a1b6044820152606401610647565b60c08201511580611dd45750428260c00151115b611e135760405162461bcd60e51b815260206004820152601060248201526f1050d0d3d1918d0e88195e1c1a5c995960821b6044820152606401610647565b600080611e24898560800151612181565b91509150611e42846060015185608001518660000151338686612215565b611e52898933876000015161257f565b8351611e60908a8a8a61275c565b886001600160a01b03167f1b44a88f1dd177e1da6d7e446e4c19954e9fe5599273385a3fda0efb64f98a7b89338760000151886060015189608001516040516112d39594939291909485526001600160a01b03938416602086015291831660408501529091166060830152608082015260a00190565b611ede61205c565b600355565b611eeb61205c565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6060600a6000611f1d85856120b6565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015611fcb5760008481526020908190206040805160e0810182526007860290920180546001600160a01b039081168452600180830154821685870152600283015493850193909352600382015416606084015260048101546080840152600581015460a08401526006015460c08301529083529092019101611f4b565b50505050905092915050565b611fdf61205c565b6001600160a01b0381166120445760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610647565b61204d81612131565b50565b6119973384848461275c565b6000546001600160a01b0316331461138c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610647565b6040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b6001546000906001600160a01b03161561212157506001546001600160a01b031690565b506000546001600160a01b031690565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60405163152a902d60e11b81526000600482018190526024820183905290819084906001600160a01b03821690632a55205a906044016040805180830381865afa9250505080156121ef575060408051601f3d908101601f191682019092526121ec91810190613412565b60015b61220057600080925092505061220e565b909350915061220e9050565b505b9250929050565b846001600160a01b038316156122325761222f8282613218565b90505b60006127106004548361224591906133b8565b61224f91906133d7565b9050600061225d8284613218565b90506001600160a01b0389166124f057873410156122bd5760405162461bcd60e51b815260206004820152601d60248201527f6e6f7420656e6f7567682045544820746f2070617920666f72204e46540000006044820152606401610647565b478415612373576000866001600160a01b03168660405160006040518083038185875af1925050503d8060008114612311576040519150601f19603f3d011682016040523d82523d6000602084013e612316565b606091505b50509050806123715760405162461bcd60e51b815260206004820152602160248201527f726f79616c7479207061796d656e7420776173206e6f742070726f63657373656044820152601960fa1b6064820152608401610647565b505b82156124305760006123836120fd565b6001600160a01b03168460405160006040518083038185875af1925050503d80600081146123cd576040519150601f19603f3d011682016040523d82523d6000602084013e6123d2565b606091505b505090508061242e5760405162461bcd60e51b815260206004820152602260248201527f7472656173757279207061796d656e7420776173206e6f742070726f63657373604482015261195960f21b6064820152608401610647565b505b6000876001600160a01b03168360405160006040518083038185875af1925050503d806000811461247d576040519150601f19603f3d011682016040523d82523d6000602084013e612482565b606091505b50509050806124d35760405162461bcd60e51b815260206004820152601e60248201527f6d61696e207061796d656e7420776173206e6f742070726f63657373656400006044820152606401610647565b6124dd8a83613218565b4710156124e957600080fd5b5050612547565b88841561250c5761250c6001600160a01b038216898888612ad7565b8215612530576125308861251e6120fd565b6001600160a01b038416919086612ad7565b6125456001600160a01b038216898985612ad7565b505b6001600160a01b038916600090815260056020526040812080548a929061256f908490613440565b9091555050505050505050505050565b6040516331a9108f60e11b81526004810184905284906001600160a01b038481169190831690636352211e90602401602060405180830381865afa1580156125cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125ef9190613257565b6001600160a01b03161461263d5760405162461bcd60e51b815260206004820152601560248201527418dd5c9c995b9d081bdddb995c881a5b9d985b1a59605a1b6044820152606401610647565b604051632142170760e11b81526001600160a01b0384811660048301528381166024830152604482018690528216906342842e0e90606401600060405180830381600087803b15801561268f57600080fd5b505af11580156126a3573d6000803e3d6000fd5b5050505060006126b386866120b6565b600090815260096020526040812080546001600160a01b031990811682556001820180548216905560028201839055600382018054909116905560040155505050505050565b6040516001600160a01b03831660248201526044810182905261199790849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612b15565b600061276884846120b6565b6000818152600a60205260408120805492935090918490811061278d5761278d61322b565b60009182526020918290206040805160e081018252600790930290910180546001600160a01b0390811680855260018301548216958501959095526002820154928401929092526003810154909116606083015260048101546080830152600581015460a08301526006015460c0820152915085906128455760405162461bcd60e51b81526020600482015260146024820152731bd999995c88191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610647565b81516001600160a01b03888116911614806128d957506040516331a9108f60e11b8152600481018690526001600160a01b03821690636352211e90602401602060405180830381865afa1580156128a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c49190613257565b6001600160a01b0316876001600160a01b0316145b6129315760405162461bcd60e51b8152602060048201526024808201527f6d757374206265206f66666572206f72204e4654206f776e657220746f2072656044820152636d6f766560e01b6064820152608401610647565b6000838152600a60205260409020805461294d90600190613218565b8154811061295d5761295d61322b565b9060005260206000209060070201600a6000858152602001908152602001600020858154811061298f5761298f61322b565b60009182526020808320845460079093020180546001600160a01b03199081166001600160a01b039485161782556001808701549083018054831691861691909117905560028087015490830155600380870154908301805490921694169390931790925560048085015490830155600580850154908301556006938401549390910192909255848152600a90915260409020805480612a3157612a31613241565b600082815260208082206007600019949094019384020180546001600160a01b031990811682556001820180548216905560028201849055600382018054909116905560048101839055600581018390556006019190915591558251604080516001600160a01b038a811682529381018990529081018790529116907f601723b1104c90f2ab300b8fada20a8587fa28ada1d891cefc8f6af708f355ff90606001611aa5565b6040516001600160a01b0380851660248301528316604482015260648101829052612b0f9085906323b872dd60e01b90608401612725565b50505050565b6000612b6a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612be79092919063ffffffff16565b8051909150156119975780806020019051810190612b88919061328d565b6119975760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610647565b6060612bf68484600085612c00565b90505b9392505050565b606082471015612c615760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610647565b6001600160a01b0385163b612cb85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610647565b600080866001600160a01b03168587604051612cd49190613477565b60006040518083038185875af1925050503d8060008114612d11576040519150601f19603f3d011682016040523d82523d6000602084013e612d16565b606091505b5091509150612d26828286612d31565b979650505050505050565b60608315612d40575081612bf9565b825115612d505782518084602001fd5b8160405162461bcd60e51b81526004016106479190613493565b6001600160a01b038116811461204d57600080fd5b801515811461204d57600080fd5b60008060408385031215612da057600080fd5b8235612dab81612d6a565b91506020830135612dbb81612d7f565b809150509250929050565b600060208284031215612dd857600080fd5b8135612bf981612d7f565b60008060408385031215612df657600080fd5b8235612e0181612d6a565b946020939093013593505050565b600080600080600060a08688031215612e2757600080fd5b8535612e3281612d6a565b9450602086013593506040860135612e4981612d6a565b94979396509394606081013594506080013592915050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215612e8a57600080fd5b8235612e9581612d6a565b915060208381013567ffffffffffffffff80821115612eb357600080fd5b818601915086601f830112612ec757600080fd5b813581811115612ed957612ed9612e61565b8060051b604051601f19603f83011681018181108582111715612efe57612efe612e61565b604052918252848201925083810185019189831115612f1c57600080fd5b938501935b82851015612f3a57843584529385019392850192612f21565b8096505050505050509250929050565b80516001600160a01b03908116835260208083015182169084015260408083015190840152606080830151909116908301526080808201519083015260a0818101519083015260c0908101519082015260e00190565b6000602080830181845280855180835260408601915060408160051b87010192508387016000805b8381101561302157888603603f19018552825180518088529088019088880190845b8181101561300b57612ffd838551612f4a565b938b01939250600101612fea565b5090975050509386019391860191600101612fc8565b509398975050505050505050565b60006020828403121561304157600080fd5b8135612bf981612d6a565b6000806000806080858703121561306257600080fd5b843561306d81612d6a565b935060208501359250604085013561308481612d6a565b9396929550929360600135925050565b6020808252825182820181905260009190848201906040850190845b818110156130d55783516001600160a01b0316835292840192918401916001016130b0565b50909695505050505050565b600080600080600060a086880312156130f957600080fd5b853561310481612d6a565b97602087013597506040870135966060810135965060800135945092505050565b60006020828403121561313757600080fd5b5035919050565b600080600080600060a0868803121561315657600080fd5b853561316181612d6a565b94506020860135935060408601359250606086013561317f81612d6a565b949793965091946080013592915050565b6020808252825182820181905260009190848201906040850190845b818110156130d5576131bf838551612f4a565b9385019392506001016131ac565b6000806000606084860312156131e257600080fd5b83356131ed81612d6a565b95602085013595506040909401359392505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156108c2576108c2613202565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006020828403121561326957600080fd5b8151612bf981612d6a565b60006020828403121561328657600080fd5b5051919050565b60006020828403121561329f57600080fd5b8151612bf981612d7f565b6000602082840312156132bc57600080fd5b815160ff81168114612bf957600080fd5b600181815b8085111561220c5781600019048211156132ee576132ee613202565b808516156132fb57918102915b93841c93908002906132d2565b600082613317575060016108c2565b81613324575060006108c2565b816001811461333a576002811461334457613360565b60019150506108c2565b60ff84111561335557613355613202565b50506001821b6108c2565b5060208310610133831016604e8410600b8410161715613383575081810a6108c2565b61338d83836132cd565b80600019048211156133a1576133a1613202565b029392505050565b6000612bf960ff841683613308565b60008160001904831182151516156133d2576133d2613202565b500290565b6000826133f457634e487b7160e01b600052601260045260246000fd5b500490565b60006001820161340b5761340b613202565b5060010190565b6000806040838503121561342557600080fd5b825161343081612d6a565b6020939093015192949293505050565b808201808211156108c2576108c2613202565b60005b8381101561346e578181015183820152602001613456565b50506000910152565b60008251613489818460208701613453565b9190910192915050565b60208152600082518060208401526134b2816040850160208701613453565b601f01601f1916919091016040019291505056fea164736f6c6343000810000a000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

Deployed Bytecode

0x6080604052600436106101c25760003560e01c806392f5a348116100f7578063e7f4e3f711610095578063f131262d11610064578063f131262d14610548578063f2fde38b14610575578063f752165214610595578063ffc96547146105b557600080fd5b8063e7f4e3f7146104c8578063eaeab137146104e8578063ec29c39d14610508578063f0f442601461052857600080fd5b8063ae6cb51a116100d1578063ae6cb51a14610450578063b1c87eb714610470578063e086e5ec14610486578063e62b9e6c1461049b57600080fd5b806392f5a348146103ea578063995bc51e1461040c578063a1db97821461043057600080fd5b80635b5b59fb11610164578063715018a61161013e578063715018a614610384578063737095e8146103995780638da5cb5b146103b95780639028c03f146103d757600080fd5b80635b5b59fb146103175780635b769f3c1461034457806361d027b31461036457600080fd5b8063358acabc116101a0578063358acabc1461023f5780633fc8cef3146102ac5780634016228c146102e45780635ade3c7d1461030457600080fd5b8063064851d4146101c7578063242271a6146101e9578063311020b514610209575b600080fd5b3480156101d357600080fd5b506101e76101e2366004612d8d565b6105e5565b005b3480156101f557600080fd5b506101e7610204366004612dc6565b6107ac565b34801561021557600080fd5b5060005461022a90600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004612de3565b61082a565b604051610236919081516001600160a01b03908116825260208084015182169083015260408084015190830152606080840151909116908201526080918201519181019190915260a00190565b3480156102b857600080fd5b506002546102cc906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102f057600080fd5b506101e76102ff366004612de3565b6108c8565b6101e7610312366004612e0f565b610a18565b34801561032357600080fd5b50610337610332366004612e77565b6112e6565b6040516102369190612fa0565b34801561035057600080fd5b506101e761035f36600461302f565b611350565b34801561037057600080fd5b506001546102cc906001600160a01b031681565b34801561039057600080fd5b506101e761137a565b3480156103a557600080fd5b506101e76103b436600461304c565b61138e565b3480156103c557600080fd5b506000546001600160a01b03166102cc565b6101e76103e536600461304c565b6115cd565b3480156103f657600080fd5b506103ff611883565b6040516102369190613094565b34801561041857600080fd5b5061042260045481565b604051908152602001610236565b34801561043c57600080fd5b506101e761044b366004612de3565b6118e5565b34801561045c57600080fd5b506101e761046b3660046130e1565b61199c565b34801561047c57600080fd5b5061042260035481565b34801561049257600080fd5b506101e7611ab6565b3480156104a757600080fd5b506104226104b636600461302f565b60056020526000908152604090205481565b3480156104d457600080fd5b506101e76104e3366004613125565b611b14565b3480156104f457600080fd5b506101e761050336600461313e565b611b7a565b34801561051457600080fd5b506101e7610523366004613125565b611ed6565b34801561053457600080fd5b506101e761054336600461302f565b611ee3565b34801561055457600080fd5b50610568610563366004612de3565b611f0d565b6040516102369190613190565b34801561058157600080fd5b506101e761059036600461302f565b611fd7565b3480156105a157600080fd5b506101e76105b03660046131cd565b612050565b3480156105c157600080fd5b5061022a6105d036600461302f565b60066020526000908152604090205460ff1681565b6105ed61205c565b6001600160a01b03821660009081526006602052604090205481151560ff9091161515036106505760405162461bcd60e51b815260206004820152600b60248201526a6d75737420746f67676c6560a81b60448201526064015b60405180910390fd5b6001600160a01b0382166000908152600660205260409020805460ff191682158015919091179091556106dd57600780546001600160a01b0384166000818152600860205260408120839055600183018455929092527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b03191690911790555050565b6001600160a01b038216600090815260086020526040812080549190556007805461070a90600190613218565b8154811061071a5761071a61322b565b600091825260209091200154600780546001600160a01b0390921691839081106107465761074661322b565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600780548061078557610785613241565b600082815260209020810160001990810180546001600160a01b0319169055019055505050565b6107b461205c565b801515600060149054906101000a900460ff1615150361080c5760405162461bcd60e51b81526020600482015260136024820152721b5d5cdd081d1bd9d9db1948195b98589b1959606a1b6044820152606401610647565b60008054911515600160a01b0260ff60a01b19909216919091179055565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526009600061086385856120b6565b81526020808201929092526040908101600020815160a08101835281546001600160a01b039081168252600183015481169482019490945260028201549281019290925260038101549092166060820152600490910154608082015290505b92915050565b6040516331a9108f60e11b815260048101829052829033906001600160a01b03831690636352211e90602401602060405180830381865afa158015610911573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109359190613257565b6001600160a01b03161461097f5760405162461bcd60e51b815260206004820152601160248201527036bab9ba1031329027232a1037bbb732b960791b6044820152606401610647565b6009600061098d85856120b6565b81526020808201929092526040908101600090812080546001600160a01b03199081168255600182018054821690556002820183905560038201805490911690556004015580516001600160a01b038616815291820184905233917f5c1eebe071e4c97619a6d2d556db16b1dca7e17db2a11816c681a412a05ad7fd910160405180910390a2505050565b6040516331a9108f60e11b8152600481018590528590600090819033906001600160a01b03851690636352211e90602401602060405180830381865afa158015610a66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8a9190613257565b6001600160a01b031603610ad55760405162461bcd60e51b815260206004820152601260248201527120a22227a323189d103737ba1037bbb732b960711b6044820152606401610647565b6001600160a01b038616610e10576003543411610b285760405162461bcd60e51b815260206004820152601160248201527008288889e8c8c647440dccacac8408aa89607b1b6044820152606401610647565b6002546001600160a01b031660009081526006602052604090205460ff16610b925760405162461bcd60e51b815260206004820152601760248201527f4144444f4646333a2057455448206e6f742076616c69640000000000000000006044820152606401610647565b600060035434610ba29190613218565b6002546040516370a0823160e01b81523060048201529192506001600160a01b03169060009082906370a0823190602401602060405180830381865afa158015610bf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c149190613274565b9050600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b158015610c6657600080fd5b505af1158015610c7a573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201526001600160a01b038616935063a9059cbb9250339150849084906370a0823190602401602060405180830381865afa158015610ccf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf39190613274565b610cfd9190613218565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610d48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6c919061328d565b506002546040805163313ce56760e01b815290516001600160a01b039092169650670de0b6b3a764000091879163313ce5679160048083019260209291908290030181865afa158015610dc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de791906132aa565b610df290600a6133a9565b610dfc90856133b8565b610e0691906133d7565b9350505050610ec4565b6003543414610e565760405162461bcd60e51b81526020600482015260126024820152714144444f4646343a206f666665722066656560701b6044820152606401610647565b6001600160a01b03861660009081526006602052604090205460ff16610ebe5760405162461bcd60e51b815260206004820152601c60248201527f4144444f4646353a20696e76616c6964206f6666657220746f6b656e000000006044820152606401610647565b50849050835b60035415610f73576000610ed66120fd565b6001600160a01b031660035460405160006040518083038185875af1925050503d8060008114610f22576040519150601f19603f3d011682016040523d82523d6000602084013e610f27565b606091505b5050905080610f715760405162461bcd60e51b81526020600482015260166024820152754144444f4646363a20616464206f666665722066656560501b6044820152606401610647565b505b6040516370a0823160e01b8152336004820152829082906001600160a01b038316906370a0823190602401602060405180830381865afa158015610fbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdf9190613274565b10156110245760405162461bcd60e51b81526020600482015260146024820152734144444f4646373a206261642062616c616e636560601b6044820152606401610647565b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa158015611070573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110949190613274565b10156110e25760405162461bcd60e51b815260206004820152601760248201527f4144444f4646383a206e65656420616c6c6f77616e63650000000000000000006044820152606401610647565b8415806110ee57504285115b61112b5760405162461bcd60e51b815260206004820152600e60248201526d3130b21032bc3834b930ba34b7b760911b6044820152606401610647565b600a60006111398b8b6120b6565b81526020019081526020016000206040518060e00160405280336001600160a01b031681526020018b6001600160a01b031681526020018a8152602001856001600160a01b0316815260200184815260200142815260200187815250908060018154018082558091505060019003906000526020600020906007020160009091909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506040820151816002015560608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506080820151816004015560a0820151816005015560c082015181600601555050336001600160a01b03167fb347d5698089b69dfa9b10f4c5340078eb108f1a97644fd5da65d1f1c06710d98a8a86866040516112d394939291906001600160a01b039485168152602081019390935292166040820152606081019190915260800190565b60405180910390a2505050505050505050565b60608060005b8351811015611348576113188585838151811061130b5761130b61322b565b6020026020010151611f0d565b82828151811061132a5761132a61322b565b60200260200101819052508080611340906133f9565b9150506112ec565b509392505050565b61135861205c565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b61138261205c565b61138c6000612131565b565b6001600160a01b03821615806113bc57506001600160a01b03821660009081526006602052604090205460ff165b6114085760405162461bcd60e51b815260206004820152601860248201527f696e76616c696420627579206974206e6f7720746f6b656e00000000000000006044820152606401610647565b6040516331a9108f60e11b815260048101849052849033906001600160a01b03831690636352211e90602401602060405180830381865afa158015611451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114759190613257565b6001600160a01b0316146114bf5760405162461bcd60e51b815260206004820152601160248201527036bab9ba1031329027232a1037bbb732b960791b6044820152606401610647565b6040518060a00160405280336001600160a01b03168152602001866001600160a01b03168152602001858152602001846001600160a01b03168152602001838152506009600061150f88886120b6565b81526020808201929092526040908101600020835181546001600160a01b03199081166001600160a01b039283161783558585015160018401805483169184169190911790558584015160028401556060808701516003850180549093169084161790915560809586015160049093019290925582518a8216815293840189905287168383015282018590525133927ff0f38eeaced5cad85b530a359e86a0d6349236e42f53160f8cc35155e54ac5a2928290030190a25050505050565b600054600160a01b900460ff166116145760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08195b98589b195960aa1b6044820152606401610647565b600061162085856120b6565b600081815260096020908152604091829020825160a08101845281546001600160a01b0390811682526001830154811693820193909352600282015481850152600382015483166060820152600491820154608082015292516331a9108f60e11b815290810188905292935090918791821690636352211e90602401602060405180830381865afa1580156116b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116dd9190613257565b6001600160a01b031682600001516001600160a01b0316146117335760405162461bcd60e51b815260206004820152600f60248201526e2124a7189d103130b21037bbb732b960891b6044820152606401610647565b846001600160a01b031682606001516001600160a01b03161461178a5760405162461bcd60e51b815260206004820152600f60248201526e2124a7191d103130b2103a37b5b2b760891b6044820152606401610647565b838260800151146117d05760405162461bcd60e51b815260206004820152601060248201526f1092538cce8818985908185b5bdd5b9d60821b6044820152606401610647565b6000806117e1898560800151612181565b915091506117ff846060015185608001513387600001518686612215565b61180f898986600001513361257f565b8351606085015160808601516040516001600160a01b038d16937f1b44a88f1dd177e1da6d7e446e4c19954e9fe5599273385a3fda0efb64f98a7b936112d3938e93339291909485526001600160a01b03938416602086015291831660408501529091166060830152608082015260a00190565b606060078054806020026020016040519081016040528092919081815260200182805480156118db57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116118bd575b5050505050905090565b6118ed61205c565b8181156118fa5781611962565b6040516370a0823160e01b81523060048201526001600160a01b038216906370a0823190602401602060405180830381865afa15801561193e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119629190613274565b91506000821161197157600080fd5b6119976119866000546001600160a01b031690565b6001600160a01b03831690846126f9565b505050565b60006119a886866120b6565b6000818152600a6020526040812080549293509091869081106119cd576119cd61322b565b6000918252602090912060079091020180549091506001600160a01b03163314611a325760405162461bcd60e51b81526020600482015260166024820152751b5d5cdd081bdddb881bd999995c881d1bc819591a5d60521b6044820152606401610647565b8315611a4057600481018490555b8215611a4e57600681018390555b8054604080516001600160a01b038a81168252602082018a905291810188905260608101879052608081018690529116907f3bb3926589ae1966c753c9ae5f116ca6e9114af7fc2ff28814e54970f9e2e6af9060a0015b60405180910390a250505050505050565b611abe61205c565b6000546001600160a01b03166001600160a01b03164760405160006040518083038185875af1925050503d8060008114611997576040519150601f19603f3d011682016040523d82523d6000602084013e505050565b611b1c61205c565b6064611b2b612710600a6133b8565b611b3591906133d7565b811115611b755760405162461bcd60e51b815260206004820152600e60248201526d6d757374206265203c3d2031302560901b6044820152606401610647565b600455565b600054600160a01b900460ff16611bc15760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08195b98589b195960aa1b6044820152606401610647565b6000600a6000611bd188886120b6565b81526020019081526020016000208481548110611bf057611bf061322b565b60009182526020918290206040805160e08101825260079390930290910180546001600160a01b03908116845260018201548116948401949094526002810154838301526003810154841660608401526004808201546080850152600582015460a085015260069091015460c084015290516331a9108f60e11b81529081018890529092508791821690636352211e90602401602060405180830381865afa158015611ca0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc49190613257565b6001600160a01b0316336001600160a01b031614611d1d5760405162461bcd60e51b815260206004820152601660248201527520a1a1a7a323189d1036bab9ba1031329037bbb732b960511b6044820152606401610647565b836001600160a01b031682606001516001600160a01b031614611d775760405162461bcd60e51b815260206004820152601260248201527120a1a1a7a323191d103130b2103a37b5b2b760711b6044820152606401610647565b82826080015114611dc05760405162461bcd60e51b81526020600482015260136024820152721050d0d3d1918cce8818985908185b5bdd5b9d606a1b6044820152606401610647565b60c08201511580611dd45750428260c00151115b611e135760405162461bcd60e51b815260206004820152601060248201526f1050d0d3d1918d0e88195e1c1a5c995960821b6044820152606401610647565b600080611e24898560800151612181565b91509150611e42846060015185608001518660000151338686612215565b611e52898933876000015161257f565b8351611e60908a8a8a61275c565b886001600160a01b03167f1b44a88f1dd177e1da6d7e446e4c19954e9fe5599273385a3fda0efb64f98a7b89338760000151886060015189608001516040516112d39594939291909485526001600160a01b03938416602086015291831660408501529091166060830152608082015260a00190565b611ede61205c565b600355565b611eeb61205c565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6060600a6000611f1d85856120b6565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015611fcb5760008481526020908190206040805160e0810182526007860290920180546001600160a01b039081168452600180830154821685870152600283015493850193909352600382015416606084015260048101546080840152600581015460a08401526006015460c08301529083529092019101611f4b565b50505050905092915050565b611fdf61205c565b6001600160a01b0381166120445760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610647565b61204d81612131565b50565b6119973384848461275c565b6000546001600160a01b0316331461138c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610647565b6040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b6001546000906001600160a01b03161561212157506001546001600160a01b031690565b506000546001600160a01b031690565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60405163152a902d60e11b81526000600482018190526024820183905290819084906001600160a01b03821690632a55205a906044016040805180830381865afa9250505080156121ef575060408051601f3d908101601f191682019092526121ec91810190613412565b60015b61220057600080925092505061220e565b909350915061220e9050565b505b9250929050565b846001600160a01b038316156122325761222f8282613218565b90505b60006127106004548361224591906133b8565b61224f91906133d7565b9050600061225d8284613218565b90506001600160a01b0389166124f057873410156122bd5760405162461bcd60e51b815260206004820152601d60248201527f6e6f7420656e6f7567682045544820746f2070617920666f72204e46540000006044820152606401610647565b478415612373576000866001600160a01b03168660405160006040518083038185875af1925050503d8060008114612311576040519150601f19603f3d011682016040523d82523d6000602084013e612316565b606091505b50509050806123715760405162461bcd60e51b815260206004820152602160248201527f726f79616c7479207061796d656e7420776173206e6f742070726f63657373656044820152601960fa1b6064820152608401610647565b505b82156124305760006123836120fd565b6001600160a01b03168460405160006040518083038185875af1925050503d80600081146123cd576040519150601f19603f3d011682016040523d82523d6000602084013e6123d2565b606091505b505090508061242e5760405162461bcd60e51b815260206004820152602260248201527f7472656173757279207061796d656e7420776173206e6f742070726f63657373604482015261195960f21b6064820152608401610647565b505b6000876001600160a01b03168360405160006040518083038185875af1925050503d806000811461247d576040519150601f19603f3d011682016040523d82523d6000602084013e612482565b606091505b50509050806124d35760405162461bcd60e51b815260206004820152601e60248201527f6d61696e207061796d656e7420776173206e6f742070726f63657373656400006044820152606401610647565b6124dd8a83613218565b4710156124e957600080fd5b5050612547565b88841561250c5761250c6001600160a01b038216898888612ad7565b8215612530576125308861251e6120fd565b6001600160a01b038416919086612ad7565b6125456001600160a01b038216898985612ad7565b505b6001600160a01b038916600090815260056020526040812080548a929061256f908490613440565b9091555050505050505050505050565b6040516331a9108f60e11b81526004810184905284906001600160a01b038481169190831690636352211e90602401602060405180830381865afa1580156125cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125ef9190613257565b6001600160a01b03161461263d5760405162461bcd60e51b815260206004820152601560248201527418dd5c9c995b9d081bdddb995c881a5b9d985b1a59605a1b6044820152606401610647565b604051632142170760e11b81526001600160a01b0384811660048301528381166024830152604482018690528216906342842e0e90606401600060405180830381600087803b15801561268f57600080fd5b505af11580156126a3573d6000803e3d6000fd5b5050505060006126b386866120b6565b600090815260096020526040812080546001600160a01b031990811682556001820180548216905560028201839055600382018054909116905560040155505050505050565b6040516001600160a01b03831660248201526044810182905261199790849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612b15565b600061276884846120b6565b6000818152600a60205260408120805492935090918490811061278d5761278d61322b565b60009182526020918290206040805160e081018252600790930290910180546001600160a01b0390811680855260018301548216958501959095526002820154928401929092526003810154909116606083015260048101546080830152600581015460a08301526006015460c0820152915085906128455760405162461bcd60e51b81526020600482015260146024820152731bd999995c88191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610647565b81516001600160a01b03888116911614806128d957506040516331a9108f60e11b8152600481018690526001600160a01b03821690636352211e90602401602060405180830381865afa1580156128a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c49190613257565b6001600160a01b0316876001600160a01b0316145b6129315760405162461bcd60e51b8152602060048201526024808201527f6d757374206265206f66666572206f72204e4654206f776e657220746f2072656044820152636d6f766560e01b6064820152608401610647565b6000838152600a60205260409020805461294d90600190613218565b8154811061295d5761295d61322b565b9060005260206000209060070201600a6000858152602001908152602001600020858154811061298f5761298f61322b565b60009182526020808320845460079093020180546001600160a01b03199081166001600160a01b039485161782556001808701549083018054831691861691909117905560028087015490830155600380870154908301805490921694169390931790925560048085015490830155600580850154908301556006938401549390910192909255848152600a90915260409020805480612a3157612a31613241565b600082815260208082206007600019949094019384020180546001600160a01b031990811682556001820180548216905560028201849055600382018054909116905560048101839055600581018390556006019190915591558251604080516001600160a01b038a811682529381018990529081018790529116907f601723b1104c90f2ab300b8fada20a8587fa28ada1d891cefc8f6af708f355ff90606001611aa5565b6040516001600160a01b0380851660248301528316604482015260648101829052612b0f9085906323b872dd60e01b90608401612725565b50505050565b6000612b6a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612be79092919063ffffffff16565b8051909150156119975780806020019051810190612b88919061328d565b6119975760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610647565b6060612bf68484600085612c00565b90505b9392505050565b606082471015612c615760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610647565b6001600160a01b0385163b612cb85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610647565b600080866001600160a01b03168587604051612cd49190613477565b60006040518083038185875af1925050503d8060008114612d11576040519150601f19603f3d011682016040523d82523d6000602084013e612d16565b606091505b5091509150612d26828286612d31565b979650505050505050565b60608315612d40575081612bf9565b825115612d505782518084602001fd5b8160405162461bcd60e51b81526004016106479190613493565b6001600160a01b038116811461204d57600080fd5b801515811461204d57600080fd5b60008060408385031215612da057600080fd5b8235612dab81612d6a565b91506020830135612dbb81612d7f565b809150509250929050565b600060208284031215612dd857600080fd5b8135612bf981612d7f565b60008060408385031215612df657600080fd5b8235612e0181612d6a565b946020939093013593505050565b600080600080600060a08688031215612e2757600080fd5b8535612e3281612d6a565b9450602086013593506040860135612e4981612d6a565b94979396509394606081013594506080013592915050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215612e8a57600080fd5b8235612e9581612d6a565b915060208381013567ffffffffffffffff80821115612eb357600080fd5b818601915086601f830112612ec757600080fd5b813581811115612ed957612ed9612e61565b8060051b604051601f19603f83011681018181108582111715612efe57612efe612e61565b604052918252848201925083810185019189831115612f1c57600080fd5b938501935b82851015612f3a57843584529385019392850192612f21565b8096505050505050509250929050565b80516001600160a01b03908116835260208083015182169084015260408083015190840152606080830151909116908301526080808201519083015260a0818101519083015260c0908101519082015260e00190565b6000602080830181845280855180835260408601915060408160051b87010192508387016000805b8381101561302157888603603f19018552825180518088529088019088880190845b8181101561300b57612ffd838551612f4a565b938b01939250600101612fea565b5090975050509386019391860191600101612fc8565b509398975050505050505050565b60006020828403121561304157600080fd5b8135612bf981612d6a565b6000806000806080858703121561306257600080fd5b843561306d81612d6a565b935060208501359250604085013561308481612d6a565b9396929550929360600135925050565b6020808252825182820181905260009190848201906040850190845b818110156130d55783516001600160a01b0316835292840192918401916001016130b0565b50909695505050505050565b600080600080600060a086880312156130f957600080fd5b853561310481612d6a565b97602087013597506040870135966060810135965060800135945092505050565b60006020828403121561313757600080fd5b5035919050565b600080600080600060a0868803121561315657600080fd5b853561316181612d6a565b94506020860135935060408601359250606086013561317f81612d6a565b949793965091946080013592915050565b6020808252825182820181905260009190848201906040850190845b818110156130d5576131bf838551612f4a565b9385019392506001016131ac565b6000806000606084860312156131e257600080fd5b83356131ed81612d6a565b95602085013595506040909401359392505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156108c2576108c2613202565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006020828403121561326957600080fd5b8151612bf981612d6a565b60006020828403121561328657600080fd5b5051919050565b60006020828403121561329f57600080fd5b8151612bf981612d7f565b6000602082840312156132bc57600080fd5b815160ff81168114612bf957600080fd5b600181815b8085111561220c5781600019048211156132ee576132ee613202565b808516156132fb57918102915b93841c93908002906132d2565b600082613317575060016108c2565b81613324575060006108c2565b816001811461333a576002811461334457613360565b60019150506108c2565b60ff84111561335557613355613202565b50506001821b6108c2565b5060208310610133831016604e8410600b8410161715613383575081810a6108c2565b61338d83836132cd565b80600019048211156133a1576133a1613202565b029392505050565b6000612bf960ff841683613308565b60008160001904831182151516156133d2576133d2613202565b500290565b6000826133f457634e487b7160e01b600052601260045260246000fd5b500490565b60006001820161340b5761340b613202565b5060010190565b6000806040838503121561342557600080fd5b825161343081612d6a565b6020939093015192949293505050565b808201808211156108c2576108c2613202565b60005b8381101561346e578181015183820152602001613456565b50506000910152565b60008251613489818460208701613453565b9190910192915050565b60208152600082518060208401526134b2816040850160208701613453565b601f01601f1916919091016040019291505056fea164736f6c6343000810000a

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

-----Decoded View---------------
Arg [0] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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