hasValidKey
on the smart-contract (or balanceOf
). Internally, the lock contract keeps track of the list of members thru the expiration of their membership. So when hasValidKey
is checked, it simply verifies that the expiration for that specific address is in the future.hasValidKey
method so that a 3rd party application could also "override" the default behavior of the hasValidKey
function. If the hook is set, then the contract will call it and use the hook's response to determine if indeed the address should be treated as having a valid key.Contract
and then the Write Contract
buttons.Connect to Web3
button in the block explorer. It is important that you do that from an address that is a Lock Manager on your lock (the account you used to deploy the lock is a lock manager).createMapping
form, enter the following values:_lockAddress
: this is the address for your lock (you can get it from your Unlock Dashboard)_nftAddress
: that is the address for your pre-existing NFT contract (ERC721 or ERC1155). Note that this field is called _tokenAddress
in the case of an ERC20._tokenTypeId
: (only for ERC1155) the id of the type of token to check_minAmount
: (only for ERC20) the minimum amount of ERC20 that should be heldWrite
. You will be prompted to send a transaction by your wallet. Validate and wait for this to have been executed.Contract
and then Write as Proxy
. Proceed to connect your wallet.SetEvenHooks
function:validKey
function, so you will enter the address of the hook contract for your network (see list above!) in the _onValidKeyHook
field. Make sure you add 0x0000000000000000000000000000000000000000
in all the other fields to leave them unset.Write
, confirm the transaction in your wallet and you should be all set!