Hello, I’m implementing this functionality found here: https://github.com/OpenZeppelin/workshops/blob/master/06-nft-merkle-drop/test/3-ERC721LazyMintWith712Signature.test.js
and am looking at this code snippet starting on line 40:
NFT: [
{ name: 'tokenId', type: 'uint256' },
{ name: 'account', type: 'address' },
],
These tokens are coming from the json file here: https://github.com/OpenZeppelin/workshops/blob/master/06-nft-merkle-drop/test/tokens.json
I understand all of this code except what is happening in the original signature from the owner authorizing the token to be redeemed. What is this “account” found in the key value pair of the token? Is this the address the token will be minted at? How is this calculated?
In the actual smart contract we have
require(_verify(signer, _hash(account, tokenId), signature), "Invalid signature");
where “account” is the same one assigned to each token. Can someone help clarify what this is? I don’t think its the buyer address, because how could the seller sign off on selling to a particular address before they even know who is going to buy it?
Furthermore, in the mint function in the redeem function, this is called:
_safeMint(account, tokenId);
where again account is the one specified in the tokens.json file. I don’t understand why we would mint to this address