Contract 0x0C0cEEcF5C14EBF1Fcf6779F92766128eeE7098C

 
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0x58a96e502a24080b0694fc875a51f0e8f8bd15c9c844c50281d48476d2fe533bCreate Mapping380431982023-01-13 22:20:4266 days 4 hrs ago0x6618a18f5fc81bb36871f71a7c23b4bf93622d79 IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.003397640285 42.37304557
0xb8e0d30a8494bf6f9249814a1cd417758ccab2dd857aa70d654e667b96f3ab40Create Mapping377492782023-01-06 16:55:0073 days 9 hrs ago0xbc3968ebf2bc56e2b8db351625ff0b2ae36784a8 IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.005510770681 68.726562431
0x8940ea11e8c70d35abf24abd0645a819158f7624c49d5d31c81f0e2d69d9e41cCreate Mapping377140012023-01-05 19:46:1174 days 6 hrs ago0x6618a18f5fc81bb36871f71a7c23b4bf93622d79 IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.004116197262 51.334396673
0x2ab38b4f5f7cd170fbcf8922249d387e1b43f419dd3d62c87c6264e1b184adc6Create Mapping377137262023-01-05 19:36:4174 days 6 hrs ago0x6618a18f5fc81bb36871f71a7c23b4bf93622d79 IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.003988737325 49.744803516
0x44c8cbd61789d71dbc277b7e12a2db9144d83e8c6bd0d051377edb9896876c52Create Mapping377114622023-01-05 18:09:1074 days 8 hrs ago0xfb4a6ba80bd9363a3c38e7ed8a0a56b4e398833a IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.002687584456 62.235653411
0xc38d5e26c5bd1c07477c44c565c6bc019b8761ecc221b58e3a16ff592c0b184dCreate Mapping377112002023-01-05 18:00:1074 days 8 hrs ago0xfb4a6ba80bd9363a3c38e7ed8a0a56b4e398833a IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.008292093003 103.413311923
0x4d503030db4f54913964836bac20dcf87f417d93061cc1133e68917808d39c93Create Mapping377111262023-01-05 17:56:1674 days 8 hrs ago0xfb4a6ba80bd9363a3c38e7ed8a0a56b4e398833a IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.004259396059 98.633662
0xebdc049af62781d68c40f81e7ad748b636b4768776a5633f53519f1ce9fc8cbbCreate Mapping377105002023-01-05 17:29:4274 days 8 hrs ago0xfb4a6ba80bd9363a3c38e7ed8a0a56b4e398833a IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.003647608484 60.495032574
0x00d61ee4aab359b1cbc396a866a7503b36cc2dc9bc8bb8e1cef6e2e2b76dc7b5Create Mapping377098612023-01-05 17:07:4474 days 9 hrs ago0xfb4a6ba80bd9363a3c38e7ed8a0a56b4e398833a IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.003633998591 60.293313502
0xd0095cc1d7764e18f4c045fd3fedc2a28fed56a1c8b1a06b10df4009bef75f98Create Mapping376761232023-01-04 21:11:3875 days 5 hrs ago0xfb4a6ba80bd9363a3c38e7ed8a0a56b4e398833a IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.002702550786 44.839241877
0x5c2602c1c774ccdb2dab1b8221de46745285a53ee1619daca4744c6cfb25f219Create Mapping376638032023-01-04 13:29:4175 days 12 hrs ago0xbc3968ebf2bc56e2b8db351625ff0b2ae36784a8 IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.003608270604 59.866448838
0x943c025d2f93e6d4e8178a47b000933dff4fb2a584071271f7421d1fe091c031Create Mapping376310092023-01-03 17:48:4076 days 8 hrs ago0xbc3968ebf2bc56e2b8db351625ff0b2ae36784a8 IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.002453463602 40.72273939
0x88301f44123e1417fce2a339e5f6163acb4cb7a855eb245f5847cc082cfb6f4fCreate Mapping370344802022-12-19 22:26:3591 days 3 hrs ago0x6618a18f5fc81bb36871f71a7c23b4bf93622d79 IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.006349998787 79.192841309
0xd254222f9143a80d164564de4df02c7290f4af67c4048a3a68cf7be926faa3b9Create Mapping369144342022-12-16 21:14:0694 days 5 hrs ago0x6618a18f5fc81bb36871f71a7c23b4bf93622d79 IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.015093348791 188.233921871
0xf102c622607adc582806da75a7b315d5de79f84c08bd2d973adedb0a08950806Create Mapping369123652022-12-16 19:52:2294 days 6 hrs ago0x6618a18f5fc81bb36871f71a7c23b4bf93622d79 IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.003747710229 46.738878444
0xab44f9a1187b71cead182f4d57843aa35dac6aab8932ea267771a2c0e197b358Create Mapping361471642022-11-27 21:52:50113 days 4 hrs ago0x34ea7c2bcdd5cf865ef325b55e1bb4a904322704 IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.001306680001 30.000000023
0xb84bd2fded1d748137425593b625edb1fcfed0307cc6b61f0afc60af2a0e209fCreate Mapping361446082022-11-27 20:24:58113 days 6 hrs ago0x34ea7c2bcdd5cf865ef325b55e1bb4a904322704 IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.00240588 30.000000012
0xeb5b0aa07a10a688ef9d57c45def136438b264d18d8f6d0bc32a3ecf181de535Create Mapping326969502022-09-04 22:17:37197 days 4 hrs ago0x6ee4c37aad2a4cce41433050608e3620fe369dca IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.002520976501 31.500000013
0xc33bb4e61b0e15e7d23008f9f1f76c0d635a42af695092552c0e807d1002b4aaCreate Mapping326941902022-09-04 20:42:45197 days 5 hrs ago0x6ee4c37aad2a4cce41433050608e3620fe369dca IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.00240093 30.00000001
0xd7fb79b6d5eee8691bdf1b9a5c6e91e8135feb1a6e70b0bb88ba48938a9a0a88Create Mapping320816582022-08-19 18:41:16213 days 7 hrs ago0xe8ed68d54bfc501c7dc8832948880071c9f83084 IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.00241663815 30.21779767
0x40d239d9ac79d3008882ef983ffc1ed2c3c3f24bf702915b2e8075b6411532dbCreate Mapping306924842022-07-13 21:04:31250 days 5 hrs ago0x9e41df694dc7420bed37074d1b54d6442ac0065c IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.002401380001 30.000000015
0x890c4f87daf863c64f9064ae0074bc4e01d3955b382bdef47139ff29fcf7fcb6Create Mapping306918512022-07-13 20:40:34250 days 5 hrs ago0x9e41df694dc7420bed37074d1b54d6442ac0065c IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.002407140001 30.000000013
0x3822e32ca7dd1686ba85def118fd54ed00231b7e8d0144bec9bef897b74dd520Create Mapping306178642022-07-11 21:52:46252 days 4 hrs ago0x9e41df694dc7420bed37074d1b54d6442ac0065c IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.00296922006 37.005160403
0x2b699f9c12387f42bd5081277e893264eb0429604abdc82c5d6b391dcb782563Create Mapping303794142022-07-05 20:50:04258 days 5 hrs ago0x9e41df694dc7420bed37074d1b54d6442ac0065c IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.001940220828 47.980138193
0xf2118dd4a6eb17cf2103c167697bea6fc9121206a7d33ac3bb854950edf8eeafCreate Mapping303781812022-07-05 20:01:18258 days 6 hrs ago0x9e41df694dc7420bed37074d1b54d6442ac0065c IN  0x0c0ceecf5c14ebf1fcf6779f92766128eee7098c0 MATIC0.014324563705 178.525931672
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ERC1155BalanceOfHook

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 80 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

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

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

contract ERC1155BalanceOfHook {
  
  // store contract mapping lock => nft (erc1155)
  mapping(address => address) public nftAddresses;

  // nft (erc1155) => token type (id)
  mapping(address => uint256) public nftTokenIds;

  function createMapping(
    address _lockAddress, 
    address _nftAddress,
    uint _tokenTypeId
  ) 
  external 
  {
    require(_lockAddress != address(0), 'Lock address can not be zero');
    require(_nftAddress != address(0), 'ERC1155 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;

    // store tokens
    nftTokenIds[_lockAddress] = _tokenTypeId;
  }

  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 token type
    uint tokenTypeId = nftTokenIds[_lockAddress];

    // get nft balance
    IERC1155 nft = IERC1155(nftAddress);
    return nft.balanceOf(_keyOwner, tokenTypeId) > 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 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        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": 80
  },
  "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"},{"internalType":"uint256","name":"_tokenTypeId","type":"uint256"}],"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"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nftTokenIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506104e1806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80632009bc981461005157806329dbabe414610066578063a0998a9314610099578063e16cc71e146100da575b600080fd5b61006461005f3660046103dd565b6100fd565b005b6100866100743660046103bc565b60016020526000908152604090205481565b6040519081526020015b60405180910390f35b6100c26100a73660046103bc565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610090565b6100ed6100e8366004610418565b6102c1565b6040519015158152602001610090565b6001600160a01b0383166101585760405162461bcd60e51b815260206004820152601c60248201527f4c6f636b20616464726573732063616e206e6f74206265207a65726f0000000060448201526064015b60405180910390fd5b6001600160a01b0382166101ae5760405162461bcd60e51b815260206004820152601f60248201527f4552433131353520616464726573732063616e206e6f74206265207a65726f00604482015260640161014f565b60405163aae4b8f760e01b815233600482015283906001600160a01b0382169063aae4b8f79060240160206040518083038186803b1580156101ef57600080fd5b505afa158015610203573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102279190610466565b6102855760405162461bcd60e51b815260206004820152602960248201527f43616c6c657220646f6573206e6f74206861766520746865204c6f636b4d616e6044820152686167657220726f6c6560b81b606482015260840161014f565b506001600160a01b0392831660009081526020818152604080832080546001600160a01b03191695909616949094179094556001909352912055565b600081156102d157506001610398565b6001600160a01b0380861660009081526020819052604090205416806102fb576000915050610398565b6001600160a01b03868116600090815260016020526040808220549051627eeac760e11b815288841660048201526024810182905290928492919083169062fdd58e9060440160206040518083038186803b15801561035957600080fd5b505afa15801561036d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103919190610482565b1193505050505b949350505050565b80356001600160a01b03811681146103b757600080fd5b919050565b6000602082840312156103cd578081fd5b6103d6826103a0565b9392505050565b6000806000606084860312156103f1578182fd5b6103fa846103a0565b9250610408602085016103a0565b9150604084013590509250925092565b6000806000806080858703121561042d578081fd5b610436856103a0565b9350610444602086016103a0565b925060408501359150606085013561045b8161049a565b939692955090935050565b600060208284031215610477578081fd5b81516103d68161049a565b600060208284031215610493578081fd5b5051919050565b80151581146104a857600080fd5b5056fea264697066735822122067f54d65b7668900234dba8cb82a6884579282a82e043848ad250d0e9d5e8c4864736f6c63430008020033

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.