@@ -99,10 +99,15 @@ contract ERC1155LazyMint is
99
99
100
100
/**
101
101
* @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,
103
106
* for e.g. price collection, allowlist, max quantity, etc.
104
107
*
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.
106
111
*
107
112
* @param _receiver The recipient of the tokens to mint.
108
113
* @param _tokenId The tokenId of the lazy minted NFT to mint.
@@ -112,7 +117,7 @@ contract ERC1155LazyMint is
112
117
address _receiver ,
113
118
uint256 _tokenId ,
114
119
uint256 _quantity
115
- ) public payable virtual nonReentrant {
120
+ ) public payable nonReentrant {
116
121
require (_tokenId < nextTokenIdToMint (), "invalid id " );
117
122
verifyClaim (msg .sender , _tokenId, _quantity); // Add your claim verification logic by overriding this function.
118
123
@@ -208,9 +213,11 @@ contract ERC1155LazyMint is
208
213
209
214
/**
210
215
* @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.
212
218
*
213
219
* @dev Override this function to add logic for state updation.
220
+ * When overriding, apply any state changes before `_mint`.
214
221
*/
215
222
function transferTokensOnClaim (
216
223
address _receiver ,
0 commit comments