Contract 0xf705b2dd649bbcb9418d08c1ff508a983f923516

 
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0x4fc01c2995821cd70e97392e61ac1bdc8ced3d130960d32c94cbd5d0e5bb7f66Create Mapping400451152023-03-06 20:39:2114 days 4 hrs ago0x94e6e840b0c9ca40c2aefbc51d37819c0e654319 IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.004010191585 69.318114936
0x62be3be7577281ded4f4521a1db36096c520b9cfad862225f8d00d588e9ff979Create Mapping382775592023-01-19 16:50:4260 days 8 hrs ago0x66cd14267fb5a1609496cdc37eb55e6fe3f59c75 IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.004218705929 72.922386942
0xb55ab86194272843c9331dc081864d284d3f3dd220740e7d54aa79efdf9de508Create Mapping378712062023-01-09 17:53:5770 days 7 hrs ago0xbc3968ebf2bc56e2b8db351625ff0b2ae36784a8 IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.003251351432 56.201193268
0x09cf79f2b9ee1853c2e0af0b5e972ba277df2ac3276246c6f3ad9d2781ee3122Create Mapping376840002023-01-05 1:55:5474 days 23 hrs ago0xfb4a6ba80bd9363a3c38e7ed8a0a56b4e398833a IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.004864561204 84.086309974
0x04cc7f48ab582ccb799a4b9b7724c78e400ddba540f15e21e8b20d83b453b04fCreate Mapping376827932023-01-05 1:12:1575 days 9 mins ago0xfb4a6ba80bd9363a3c38e7ed8a0a56b4e398833a IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.004173428812 72.139749928
0xf5c8182a1fdea1c7960041178fc55fc71ae04a74990329e27718f1a2497c0865Create Mapping361497192022-11-27 23:20:41113 days 2 hrs ago0x34ea7c2bcdd5cf865ef325b55e1bb4a904322704 IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.00173556 30.000000015
0x16e950d0b7f25b9e566844a8a8f331fa3e1674dc06da81a898cb2a716e8d4b57Create Mapping352778722022-11-06 15:38:00134 days 9 hrs ago0x5c235931376b21341fa00d8a606e498e1059ecc0 IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.020540472219 355.052067683
0x1006bc5b5dc1b51c72d2ae1b709bb4c4f9d6aefce4bb4c7fc4c12f7996a87e8cCreate Mapping351115012022-11-02 14:14:48138 days 11 hrs ago0x6c0250ac3073e95d0524d6c0358d28e6cd1cd873 IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.003582324129 62.086416225
0x1a0a6188ccdbce38faa11141fad7dda57efdd0ef8ba1db974626bd4ece9c1571Create Mapping344133662022-10-16 11:02:18155 days 14 hrs ago0x029cb45ef8f6dcd8191f8ce238730983e47b2a08 IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.007388660515 128.081899129
0x44e52fb64be068cfe46bbacaf6fbc7a092773e34557b1185ce5727dbcd8b04e7Create Mapping337589822022-09-30 15:21:37171 days 10 hrs ago0x75129d526095e415a1d9b205e6ae998e302836cb IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.00116991449 30.950937598
0x1bc751c947fb3f6c01f93bcb6a9833002c28d7cb63a5209d331de83c3ed0d3fdCreate Mapping337586592022-09-30 15:10:31171 days 10 hrs ago0x75129d526095e415a1d9b205e6ae998e302836cb IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.001757903838 43.299190579
0x9f433e8928f24ff311a836c3a2400fa2634cb5771a70ee2630291922cd25057bCreate Mapping335524902022-09-25 14:42:03176 days 10 hrs ago0x75129d526095e415a1d9b205e6ae998e302836cb IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.00173097 30.000000014
0x84999ff321c99598bf293917d65c992c79457d16c4552e7551ad05ab58de1d80Create Mapping328836052022-09-09 10:19:54192 days 15 hrs ago0xd778f0a12cae7dfce7603182185b839a6a88dffc IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.00097857 30.000000018
0xb69ef150b36c8e88afd9f43f73d9b45c92542f832ad9b2293f40e773f18f3b33Create Mapping328829002022-09-09 9:55:40192 days 15 hrs ago0xd778f0a12cae7dfce7603182185b839a6a88dffc IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.00097857 30.000000012
0xbf69ac9d7985cf790cf2b83f7e1fd6411f50aca121264ab1d2eb2291c46b46ddCreate Mapping328450142022-09-08 12:00:58193 days 13 hrs ago0xd778f0a12cae7dfce7603182185b839a6a88dffc IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.00125856904 31.000001007
0x7d27ddcaceeececebd0e4bbe59e696a430fb6751109c706d8b69a8c37e76ea42Create Mapping328108772022-09-07 16:14:33194 days 9 hrs ago0xd778f0a12cae7dfce7603182185b839a6a88dffc IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.001846596092 32.003953137
0x7b7ff925c489ea9178bad1a91f0f0ef20c32c631200244dc19869b0fdb647ff3Create Mapping319160302022-08-15 10:21:25217 days 15 hrs ago0xe8ed68d54bfc501c7dc8832948880071c9f83084 IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.001730965321 30.029584709
0x9b1fb2597ee6762e0e1dfa5ee00667a4addc259d0c3fcf7f4a518399fda199c5Create Mapping314031582022-08-01 18:22:22231 days 6 hrs ago sangbejo19.bitcoin  IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.00197753228234.300001427
0xe3b2bf9136c79bc477b7712075fccaea8abd5872247fc0188f00175e73fa14e2Create Mapping307001042022-07-14 2:45:27249 days 22 hrs ago0x1297948307c6d53c2a63f8472679938375c51276 IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.009582732609 166.211062714
0x59b67b004b77f87cfca37a3f6a61d04dfd6362a1b00560f6edfd0e27280c128dCreate Mapping306917642022-07-13 20:37:32250 days 4 hrs ago0x9e41df694dc7420bed37074d1b54d6442ac0065c IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.00172962 30.000000013
0x25562816a3cd8b460b7b152cab6a0a3506d1517ea0865e165aa308bbb3e3471dCreate Mapping305817332022-07-10 23:51:19253 days 1 hr ago0x7ea1bb15c6d91827a37697c75b2eeee930c0c188 IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.001733655779 30.069999997
0xd46a10f2144e2a8eb1c52450db112984795637dac0efd56a9d615bdb046cce87Create Mapping304935552022-07-08 18:44:14255 days 6 hrs agoCalaveralia: Deployer IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.001733682953 30.070471325
0x32bade53ceb0d76f9aa348fce0b4bc6c9327f0c8a4c73dc67889c9fd976e89aeCreate Mapping304434222022-07-07 12:48:28256 days 12 hrs ago0xc5a3efc6f59a74fb2e32ba9421759aa5424fccd4 IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.00172962108 30.000018739
0xfa96c23d06488e2e80c609079abf9989657c4c35500b35fe06025b5c63f67b2fCreate Mapping303814862022-07-05 22:07:40258 days 3 hrs ago0x9e41df694dc7420bed37074d1b54d6442ac0065c IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.003219754778 55.846164682
0x27b5ff29a2d08607fb11a3dba989c52bf7a8b35a1d1ce94f7ce70afe560e10a3Create Mapping294851822022-06-12 17:17:40281 days 8 hrs ago0x50c898b3c8c10194f3073108370492052bcff410 IN  0xf705b2dd649bbcb9418d08c1ff508a983f9235160 MATIC0.00172962 30.000000013
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ERC721BalanceOfHook

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 4 : ERC721BalanceOfHook.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

import '@unlock-protocol/contracts/dist/PublicLock/IPublicLockV9.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';

contract ERC721BalanceOfHook {
  
  mapping(address => address) public nftAddresses;

  function createMapping(
    address _lockAddress, 
    address _nftAddress
  ) 
  external 
  {
    require(_lockAddress != address(0), 'Lock address can not be zero');
    require(_nftAddress != address(0), 'ERC721 address can not be zero');

    // make sure lock manager
    IPublicLockV9 lock = IPublicLockV9(_lockAddress);
    require(lock.isLockManager(msg.sender), 'Caller does not have the LockManager role');
    
    // store mapping
    nftAddresses[_lockAddress] = _nftAddress;
  }

  function hasValidKey(
    address _lockAddress,
    address _keyOwner,
    uint256, // _expirationTimestamp,
    bool isValidKey
  ) 
  external view
  returns (bool)
  {
    if (isValidKey) return true;

    // get nft contract 
    address nftAddress = nftAddresses[_lockAddress];
    if(nftAddress == address(0)) return false;

    // get nft balance
    IERC721 nft = IERC721(nftAddress);
    return nft.balanceOf(_keyOwner) > 0;
  }

}

File 2 of 4 : IPublicLockV9.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.17 <0.9.0;

/**
* @title The PublicLock Interface
* @author Nick Furfaro (unlock-protocol.com)
 */


interface IPublicLockV9
{

// See indentationissue description here:
// https://github.com/duaraghav8/Ethlint/issues/268
// solium-disable indentation

  /// Functions
  function initialize(
    address _lockCreator,
    uint _expirationDuration,
    address _tokenAddress,
    uint _keyPrice,
    uint _maxNumberOfKeys,
    string calldata _lockName
  ) external;

  /**
   * @notice Allow the contract to accept tips in ETH sent directly to the contract.
   * @dev This is okay to use even if the lock is priced in ERC-20 tokens
   */
  // receive() external payable;

  // roles
  function DEFAULT_ADMIN_ROLE() external pure returns (bytes32);
  function KEY_GRANTER_ROLE() external pure returns (bytes32);
  function LOCK_MANAGER_ROLE() external pure returns (bytes32);

  /**
  * @notice The version number of the current implementation on this network.
  * @return The current version number.
  */
  function publicLockVersion() external pure returns (uint16);

  /**
  * @notice Used to disable lock before migrating keys and/or destroying contract.
  * @dev Throws if called by other than a lock manager.
  * @dev Throws if lock contract has already been disabled.
  */
  function disableLock() external;

  /**
   * @dev Called by a lock manager or beneficiary to withdraw all funds from the lock and send them to the `beneficiary`.
   * @dev Throws if called by other than a lock manager or beneficiary
   * @param _tokenAddress specifies the token address to withdraw or 0 for ETH. This is usually
   * the same as `tokenAddress` in MixinFunds.
   * @param _amount specifies the max amount to withdraw, which may be reduced when
   * considering the available balance. Set to 0 or MAX_UINT to withdraw everything.
   *  -- however be wary of draining funds as it breaks the `cancelAndRefund` and `expireAndRefundFor`
   * use cases.
   */
  function withdraw(
    address _tokenAddress,
    uint _amount
  ) external;

  /**
   * @notice An ERC-20 style approval, allowing the spender to transfer funds directly from this lock.
   */
  function approveBeneficiary(
    address _spender,
    uint _amount
  ) external
    returns (bool);

  /**
   * A function which lets a Lock manager of the lock to change the price for future purchases.
   * @dev Throws if called by other than a Lock manager
   * @dev Throws if lock has been disabled
   * @dev Throws if _tokenAddress is not a valid token
   * @param _keyPrice The new price to set for keys
   * @param _tokenAddress The address of the erc20 token to use for pricing the keys,
   * or 0 to use ETH
   */
  function updateKeyPricing( uint _keyPrice, address _tokenAddress ) external;

  /**
   * A function to change the default duration of each key in the lock
   * @notice keys previously bought are unaffected by this change (i.e.
   * existing keys timestamps are not recalculated/updated)
   * @param _newExpirationDuration the new amount of time for each key purchased 
   * or zero (0) for a non-expiring key
   */
  function setExpirationDuration(uint _newExpirationDuration) external;

  /**
   * A function which lets a Lock manager update the beneficiary account,
   * which receives funds on withdrawal.
   * @dev Throws if called by other than a Lock manager or beneficiary
   * @dev Throws if _beneficiary is address(0)
   * @param _beneficiary The new address to set as the beneficiary
   */
  function updateBeneficiary( address _beneficiary ) external;

  /**
   * Checks if the user has a non-expired key.
   * @param _user The address of the key owner
   */
  function getHasValidKey(
    address _user
  ) external view returns (bool);

  /**
   * @notice Find the tokenId for a given user
   * @return The tokenId of the NFT, else returns 0
   * @param _account The address of the key owner
  */
  function getTokenIdFor(
    address _account
  ) external view returns (uint);

  /**
  * @dev Returns the key's ExpirationTimestamp field for a given owner.
  * @param _keyOwner address of the user for whom we search the key
  * @dev Returns 0 if the owner has never owned a key for this lock
  */
  function keyExpirationTimestampFor(
    address _keyOwner
  ) external view returns (uint timestamp);
  
  /**
   * Public function which returns the total number of unique owners (both expired
   * and valid).  This may be larger than totalSupply.
   */
  function numberOfOwners() external view returns (uint);

  /**
   * Allows a Lock manager to assign a descriptive name for this Lock.
   * @param _lockName The new name for the lock
   * @dev Throws if called by other than a Lock manager
   */
  function updateLockName(
    string calldata _lockName
  ) external;

  /**
   * Allows a Lock manager to assign a Symbol for this Lock.
   * @param _lockSymbol The new Symbol for the lock
   * @dev Throws if called by other than a Lock manager
   */
  function updateLockSymbol(
    string calldata _lockSymbol
  ) external;

  /**
    * @dev Gets the token symbol
    * @return string representing the token symbol
    */
  function symbol()
    external view
    returns(string memory);

    /**
   * Allows a Lock manager to update the baseTokenURI for this Lock.
   * @dev Throws if called by other than a Lock manager
   * @param _baseTokenURI String representing the base of the URI for this lock.
   */
  function setBaseTokenURI(
    string calldata _baseTokenURI
  ) external;

  /**  @notice A distinct Uniform Resource Identifier (URI) for a given asset.
   * @dev Throws if `_tokenId` is not a valid NFT. URIs are defined in RFC
   *  3986. The URI may point to a JSON file that conforms to the "ERC721
   *  Metadata JSON Schema".
   * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
   * @param _tokenId The tokenID we're inquiring about
   * @return String representing the URI for the requested token
   */
  function tokenURI(
    uint256 _tokenId
  ) external view returns(string memory);

  /**
   * @notice Allows a Lock manager to add or remove an event hook
   */
  function setEventHooks(
    address _onKeyPurchaseHook,
    address _onKeyCancelHook,
    address _onValidKeyHook,
    address _onTokenURIHook
  ) external;

  /**
   * Allows a Lock manager to give a collection of users a key with no charge.
   * Each key may be assigned a different expiration date.
   * @dev Throws if called by other than a Lock manager
   * @param _recipients An array of receiving addresses
   * @param _expirationTimestamps An array of expiration Timestamps for the keys being granted
   */
  function grantKeys(
    address[] calldata _recipients,
    uint[] calldata _expirationTimestamps,
    address[] calldata _keyManagers
  ) external;

  /**
  * @dev Purchase function
  * @param _value the number of tokens to pay for this purchase >= the current keyPrice - any applicable discount
  * (_value is ignored when using ETH)
  * @param _recipient address of the recipient of the purchased key
  * @param _referrer address of the user making the referral
  * @param _keyManager optional address to grant managing rights to a specific address on creation
  * @param _data arbitrary data populated by the front-end which initiated the sale
  * @dev Throws if lock is disabled. Throws if lock is sold-out. Throws if _recipient == address(0).
  * @dev Setting _value to keyPrice exactly doubles as a security feature. That way if a Lock manager increases the
  * price while my transaction is pending I can't be charged more than I expected (only applicable to ERC-20 when more
  * than keyPrice is approved for spending).
  */
  function purchase(
    uint256 _value,
    address _recipient,
    address _referrer,
    address _keyManager,
    bytes calldata _data
  ) external payable;

  /**
  * @param _gasRefundValue price in wei or token in smallest price unit
  * @dev Set the value to be refunded to the sender on purchase
  */
  function setGasRefundValue(uint256 _gasRefundValue) external;
  
  /**
  * _gasRefundValue price in wei or token in smallest price unit
  * @dev Returns the value/rpice to be refunded to the sender on purchase
  */
  function gasRefundValue() external view returns (uint256 _gasRefundValue);

  /**
   * @notice returns the minimum price paid for a purchase with these params.
   * @dev this considers any discount from Unlock or the OnKeyPurchase hook.
   */
  function purchasePriceFor(
    address _recipient,
    address _referrer,
    bytes calldata _data
  ) external view
    returns (uint);

  /**
   * Allow a Lock manager to change the transfer fee.
   * @dev Throws if called by other than a Lock manager
   * @param _transferFeeBasisPoints The new transfer fee in basis-points(bps).
   * Ex: 200 bps = 2%
   */
  function updateTransferFee(
    uint _transferFeeBasisPoints
  ) external;

  /**
   * Determines how much of a fee a key owner would need to pay in order to
   * transfer the key to another account.  This is pro-rated so the fee goes down
   * overtime.
   * @dev Throws if _keyOwner does not have a valid key
   * @param _keyOwner The owner of the key check the transfer fee for.
   * @param _time The amount of time to calculate the fee for.
   * @return The transfer fee in seconds.
   */
  function getTransferFee(
    address _keyOwner,
    uint _time
  ) external view returns (uint);

  /**
   * @dev Invoked by a Lock manager to expire the user's key and perform a refund and cancellation of the key
   * @param _keyOwner The key owner to whom we wish to send a refund to
   * @param amount The amount to refund the key-owner
   * @dev Throws if called by other than a Lock manager
   * @dev Throws if _keyOwner does not have a valid key
   */
  function expireAndRefundFor(
    address _keyOwner,
    uint amount
  ) external;

   /**
   * @dev allows the key manager to expire a given tokenId
   * and send a refund to the keyOwner based on the amount of time remaining.
   * @param _tokenId The id of the key to cancel.
   */
  function cancelAndRefund(uint _tokenId) external;

  /**
   * Allow a Lock manager to change the refund penalty.
   * @dev Throws if called by other than a Lock manager
   * @param _freeTrialLength The new duration of free trials for this lock
   * @param _refundPenaltyBasisPoints The new refund penaly in basis-points(bps)
   */
  function updateRefundPenalty(
    uint _freeTrialLength,
    uint _refundPenaltyBasisPoints
  ) external;

  /**
   * @dev Determines how much of a refund a key owner would receive if they issued
   * @param _keyOwner The key owner to get the refund value for.
   * a cancelAndRefund block.timestamp.
   * Note that due to the time required to mine a tx, the actual refund amount will be lower
   * than what the user reads from this call.
   */
  function getCancelAndRefundValueFor(
    address _keyOwner
  ) external view returns (uint refund);

  function addKeyGranter(address account) external;

  function addLockManager(address account) external;

  function isKeyGranter(address account) external view returns (bool);

  function isLockManager(address account) external view returns (bool);

  function onKeyPurchaseHook() external view returns(address);

  function onKeyCancelHook() external view returns(address);
  
  function onValidKeyHook() external view returns(bool);

  function onTokenURIHook() external view returns(string memory);

  function revokeKeyGranter(address _granter) external;

  function renounceLockManager() external;

  /**
   * @dev Change the maximum number of keys the lock can edit
   * @param _maxNumberOfKeys uint the maximum number of keys
   */
  function setMaxNumberOfKeys (uint _maxNumberOfKeys) external;

  ///===================================================================
  /// Auto-generated getter functions from public state variables

  function beneficiary() external view returns (address );

  function expirationDuration() external view returns (uint256 );

  function freeTrialLength() external view returns (uint256 );

  function isAlive() external view returns (bool );

  function keyPrice() external view returns (uint256 );

  function maxNumberOfKeys() external view returns (uint256 );

  function refundPenaltyBasisPoints() external view returns (uint256 );

  function tokenAddress() external view returns (address );

  function transferFeeBasisPoints() external view returns (uint256 );

  function unlockProtocol() external view returns (address );

  function keyManagerOf(uint) external view returns (address );

  ///===================================================================

  /**
  * @notice Allows the key owner to safely share their key (parent key) by
  * transferring a portion of the remaining time to a new key (child key).
  * @dev Throws if key is not valid.
  * @dev Throws if `_to` is the zero address
  * @param _to The recipient of the shared key
  * @param _tokenId the key to share
  * @param _timeShared The amount of time shared
  * checks if `_to` is a smart contract (code size > 0). If so, it calls
  * `onERC721Received` on `_to` and throws if the return value is not
  * `bytes4(keccak256('onERC721Received(address,address,uint,bytes)'))`.
  * @dev Emit Transfer event
  */
  function shareKey(
    address _to,
    uint _tokenId,
    uint _timeShared
  ) external;

  /**
  * @notice Update transfer and cancel rights for a given key
  * @param _tokenId The id of the key to assign rights for
  * @param _keyManager The address to assign the rights to for the given key
  */
  function setKeyManagerOf(
    uint _tokenId,
    address _keyManager
  ) external;

  /// @notice A descriptive name for a collection of NFTs in this contract
  function name() external view returns (string memory _name);
  ///===================================================================

  /// From ERC165.sol
  function supportsInterface(bytes4 interfaceId) external view returns (bool);
  ///===================================================================

  /// From ERC-721
  /**
     * @dev Returns the number of NFTs in `owner`'s account.
     */
    function balanceOf(address _owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the NFT specified by `tokenId`.
     */
    function ownerOf(uint256 tokenId) external view returns (address _owner);

    /**
     * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
     * another (`to`).
     *
     * Requirements:
     * - `from`, `to` cannot be zero.
     * - `tokenId` must be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this
     * NFT by either {approve} or {setApprovalForAll}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;
    
    /**
     * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
     * another (`to`).
     *
     * Requirements:
     * - If the caller is not `from`, it must be approved to move this NFT by
     * either {approve} or {setApprovalForAll}.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;
    function approve(address to, uint256 tokenId) external;

    /**
    * @notice Get the approved address for a single NFT
    * @dev Throws if `_tokenId` is not a valid NFT.
    * @param _tokenId The NFT to find the approved address for
    * @return operator The approved address for this NFT, or the zero address if there is none
    */
    function getApproved(uint256 _tokenId) external view returns (address operator);

    function setApprovalForAll(address operator, bool _approved) external;
    function isApprovedForAll(address _owner, address operator) external view returns (bool);

    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    function totalSupply() external view returns (uint256);
    function tokenOfOwnerByIndex(address _owner, uint256 index) external view returns (uint256 tokenId);

    function tokenByIndex(uint256 index) external view returns (uint256);

    /**
    * Innherited from Open Zeppelin AccessControl.sol
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);
    function grantRole(bytes32 role, address account) external;
    function revokeRole(bytes32 role, address account) external;
    function renounceRole(bytes32 role, address account) external;
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @notice An ERC-20 style transfer.
     * @param _value sends a token with _value * expirationDuration (the amount of time remaining on a standard purchase).
     * @dev The typical use case would be to call this with _value 1, which is on par with calling `transferFrom`. If the user
     * has more than `expirationDuration` time remaining this may use the `shareKey` function to send some but not all of the token.
     */
    function transfer(
      address _to,
      uint _value
    ) external
      returns (bool success);
}

File 3 of 4 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

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

File 4 of 4 : 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
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_lockAddress","type":"address"},{"internalType":"address","name":"_nftAddress","type":"address"}],"name":"createMapping","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lockAddress","type":"address"},{"internalType":"address","name":"_keyOwner","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"isValidKey","type":"bool"}],"name":"hasValidKey","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nftAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50610479806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806344fc96c614610046578063a0998a931461005b578063e16cc71e146100a1575b600080fd5b61005961005436600461037e565b6100c4565b005b61008461006936600461035d565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100b46100af3660046103b0565b61027b565b6040519015158152602001610098565b6001600160a01b03821661011f5760405162461bcd60e51b815260206004820152601c60248201527f4c6f636b20616464726573732063616e206e6f74206265207a65726f0000000060448201526064015b60405180910390fd5b6001600160a01b0381166101755760405162461bcd60e51b815260206004820152601e60248201527f45524337323120616464726573732063616e206e6f74206265207a65726f00006044820152606401610116565b60405163aae4b8f760e01b815233600482015282906001600160a01b0382169063aae4b8f79060240160206040518083038186803b1580156101b657600080fd5b505afa1580156101ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ee91906103fe565b61024c5760405162461bcd60e51b815260206004820152602960248201527f43616c6c657220646f6573206e6f74206861766520746865204c6f636b4d616e6044820152686167657220726f6c6560b81b6064820152608401610116565b506001600160a01b03918216600090815260208190526040902080546001600160a01b03191691909216179055565b6000811561028b57506001610339565b6001600160a01b0380861660009081526020819052604090205416806102b5576000915050610339565b6040516370a0823160e01b81526001600160a01b03868116600483015282916000918316906370a082319060240160206040518083038186803b1580156102fb57600080fd5b505afa15801561030f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610333919061041a565b11925050505b949350505050565b80356001600160a01b038116811461035857600080fd5b919050565b60006020828403121561036e578081fd5b61037782610341565b9392505050565b60008060408385031215610390578081fd5b61039983610341565b91506103a760208401610341565b90509250929050565b600080600080608085870312156103c5578182fd5b6103ce85610341565b93506103dc60208601610341565b92506040850135915060608501356103f381610432565b939692955090935050565b60006020828403121561040f578081fd5b815161037781610432565b60006020828403121561042b578081fd5b5051919050565b801515811461044057600080fd5b5056fea26469706673582212201daf055886acc7c75776885eeaa5a240488e221101d1365149ace3b0a26651eb64736f6c63430008020033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.