@@ -99,10 +99,15 @@ contract ERC1155LazyMint is
9999
100100 /**
101101 * @notice Lets an address claim multiple lazy minted NFTs at once to a recipient.
102- * Contract creators should override this function to create custom logic for claiming,
102+ * This function prevents any reentrant calls, and is not allowed to be overridden.
103+ *
104+ * Contract creators should override `verifyClaim` and `transferTokensOnClaim`
105+ * functions to create custom logic for verification and claiming,
103106 * for e.g. price collection, allowlist, max quantity, etc.
104107 *
105- * @dev The logic in the `verifyClaim` function determines whether the caller is authorized to mint NFTs.
108+ * @dev The logic in `verifyClaim` determines whether the caller is authorized to mint NFTs.
109+ * The logic in `transferTokensOnClaim` does actual minting of tokens,
110+ * can also be used to apply other state changes.
106111 *
107112 * @param _receiver The recipient of the tokens to mint.
108113 * @param _tokenId The tokenId of the lazy minted NFT to mint.
@@ -112,7 +117,7 @@ contract ERC1155LazyMint is
112117 address _receiver ,
113118 uint256 _tokenId ,
114119 uint256 _quantity
115- ) public payable virtual nonReentrant {
120+ ) public payable nonReentrant {
116121 require (_tokenId < nextTokenIdToMint (), "invalid id " );
117122 verifyClaim (msg .sender , _tokenId, _quantity); // Add your claim verification logic by overriding this function.
118123
@@ -208,9 +213,11 @@ contract ERC1155LazyMint is
208213
209214 /**
210215 * @notice Mints tokens to receiver on claim.
211- * Can also use this function to apply any state changes before minting.
216+ * Any state changes related to `claim` must be applied
217+ * here by overriding this function.
212218 *
213219 * @dev Override this function to add logic for state updation.
220+ * When overriding, apply any state changes before `_mint`.
214221 */
215222 function transferTokensOnClaim (
216223 address _receiver ,
0 commit comments