@@ -14,7 +14,6 @@ import "../extension/PrimarySale.sol";
14
14
import "../extension/DropSinglePhase1155.sol " ;
15
15
import "../extension/LazyMint.sol " ;
16
16
import "../extension/DelayedReveal.sol " ;
17
- import "../extension/DefaultOperatorFilterer.sol " ;
18
17
19
18
import "../lib/CurrencyTransferLib.sol " ;
20
19
import "../lib/TWStrings.sol " ;
@@ -52,8 +51,7 @@ contract ERC1155Drop is
52
51
PrimarySale ,
53
52
LazyMint ,
54
53
DelayedReveal ,
55
- DropSinglePhase1155 ,
56
- DefaultOperatorFilterer
54
+ DropSinglePhase1155
57
55
{
58
56
using TWStrings for uint256 ;
59
57
@@ -71,6 +69,16 @@ contract ERC1155Drop is
71
69
Constructor
72
70
//////////////////////////////////////////////////////////////*/
73
71
72
+ /**
73
+ * @notice Initializes the contract with the given parameters.
74
+ *
75
+ * @param _defaultAdmin The default admin for the contract.
76
+ * @param _name The name of the contract.
77
+ * @param _symbol The symbol of the contract.
78
+ * @param _royaltyRecipient The address to which royalties should be sent.
79
+ * @param _royaltyBps The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%)
80
+ * @param _primarySaleRecipient The address to which primary sale revenue should be sent.
81
+ */
74
82
constructor (
75
83
address _defaultAdmin ,
76
84
string memory _name ,
@@ -82,14 +90,16 @@ contract ERC1155Drop is
82
90
_setupOwner (_defaultAdmin);
83
91
_setupDefaultRoyaltyInfo (_royaltyRecipient, _royaltyBps);
84
92
_setupPrimarySaleRecipient (_primarySaleRecipient);
85
- _setOperatorRestriction (true );
86
93
}
87
94
88
95
/*//////////////////////////////////////////////////////////////
89
96
ERC165 Logic
90
97
//////////////////////////////////////////////////////////////*/
91
98
92
- /// @notice Returns whether this contract supports the given interface.
99
+ /**
100
+ * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165
101
+ * @inheritdoc IERC165
102
+ */
93
103
function supportsInterface (bytes4 interfaceId ) public view virtual override (ERC1155 , IERC165 ) returns (bool ) {
94
104
return
95
105
interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
@@ -151,10 +161,11 @@ contract ERC1155Drop is
151
161
//////////////////////////////////////////////////////////////*/
152
162
153
163
/**
154
- * @notice Returns the metadata URI for an NFT.
155
- * @dev See `BatchMintMetadata` for handling of metadata in this contract.
164
+ * @notice Returns the metadata URI for an NFT.
165
+ * @dev See `BatchMintMetadata` for handling of metadata in this contract.
156
166
*
157
- * @param _tokenId The tokenId of an NFT.
167
+ * @param _tokenId The tokenId of an NFT.
168
+ * @return The metadata URI for the given NFT.
158
169
*/
159
170
function uri (uint256 _tokenId ) public view virtual override returns (string memory ) {
160
171
(uint256 batchId , ) = _getBatchId (_tokenId);
@@ -174,8 +185,9 @@ contract ERC1155Drop is
174
185
/**
175
186
* @notice Lets an authorized address reveal a batch of delayed reveal NFTs.
176
187
*
177
- * @param _index The ID for the batch of delayed-reveal NFTs to reveal.
178
- * @param _key The key with which the base URI for the relevant batch of NFTs was encrypted.
188
+ * @param _index The ID for the batch of delayed-reveal NFTs to reveal.
189
+ * @param _key The key with which the base URI for the relevant batch of NFTs was encrypted.
190
+ * @return revealedURI The revealed URI for the batch of NFTs.
179
191
*/
180
192
function reveal (uint256 _index , bytes calldata _key ) public virtual override returns (string memory revealedURI ) {
181
193
require (_canReveal (), "Not authorized " );
@@ -222,51 +234,15 @@ contract ERC1155Drop is
222
234
return nextTokenIdToLazyMint;
223
235
}
224
236
225
- /*//////////////////////////////////////////////////////////////
226
- ERC-1155 overrides
227
- //////////////////////////////////////////////////////////////*/
228
-
229
- /// @dev See {ERC1155-setApprovalForAll}
230
- function setApprovalForAll (address operator , bool approved )
231
- public
232
- virtual
233
- override (ERC1155 )
234
- onlyAllowedOperatorApproval (operator)
235
- {
236
- super .setApprovalForAll (operator, approved);
237
- }
238
-
239
- /**
240
- * @dev See {IERC1155-safeTransferFrom}.
241
- */
242
- function safeTransferFrom (
243
- address from ,
244
- address to ,
245
- uint256 id ,
246
- uint256 amount ,
247
- bytes memory data
248
- ) public virtual override (ERC1155 ) onlyAllowedOperator (from) {
249
- super .safeTransferFrom (from, to, id, amount, data);
250
- }
251
-
252
- /**
253
- * @dev See {IERC1155-safeBatchTransferFrom}.
254
- */
255
- function safeBatchTransferFrom (
256
- address from ,
257
- address to ,
258
- uint256 [] memory ids ,
259
- uint256 [] memory amounts ,
260
- bytes memory data
261
- ) public virtual override (ERC1155 ) onlyAllowedOperator (from) {
262
- super .safeBatchTransferFrom (from, to, ids, amounts, data);
263
- }
264
-
265
237
/*///////////////////////////////////////////////////////////////
266
238
Internal functions
267
239
//////////////////////////////////////////////////////////////*/
268
240
269
- /// @dev Runs before every `claim` function call.
241
+ /**
242
+ * @dev Runs before every `claim` function call.
243
+ *
244
+ * @param _tokenId The tokenId of the NFT being claimed.
245
+ */
270
246
function _beforeClaim (
271
247
uint256 _tokenId ,
272
248
address ,
@@ -281,7 +257,15 @@ contract ERC1155Drop is
281
257
}
282
258
}
283
259
284
- /// @dev Collects and distributes the primary sale value of NFTs being claimed.
260
+ /**
261
+ * @dev Collects and distributes the primary sale value of NFTs being claimed.
262
+ *
263
+ * @param _primarySaleRecipient The address to which primary sale revenue should be sent.
264
+ * @param _quantityToClaim The quantity of NFTs being claimed.
265
+ * @param _currency The currency in which the NFTs are being sold.
266
+ * @param _pricePerToken The price per NFT being claimed.
267
+ */
268
+
285
269
function _collectPriceOnClaim (
286
270
address _primarySaleRecipient ,
287
271
uint256 _quantityToClaim ,
@@ -307,7 +291,13 @@ contract ERC1155Drop is
307
291
CurrencyTransferLib.transferCurrency (_currency, msg .sender , saleRecipient, totalPrice);
308
292
}
309
293
310
- /// @dev Transfers the NFTs being claimed.
294
+ /**
295
+ * @dev Transfers the NFTs being claimed.
296
+ *
297
+ * @param _to The address to which the NFTs are being transferred.
298
+ * @param _tokenId The tokenId of the NFTs being claimed.
299
+ * @param _quantityBeingClaimed The quantity of NFTs being claimed.
300
+ */
311
301
function _transferTokensOnClaim (
312
302
address _to ,
313
303
uint256 _tokenId ,
@@ -316,7 +306,16 @@ contract ERC1155Drop is
316
306
_mint (_to, _tokenId, _quantityBeingClaimed, "" );
317
307
}
318
308
319
- /// @dev Runs before every token transfer / mint / burn.
309
+ /**
310
+ * @dev Runs before every token transfer / mint / burn.
311
+ *
312
+ * @param operator The address performing the token transfer.
313
+ * @param from The address from which the token is being transferred.
314
+ * @param to The address to which the token is being transferred.
315
+ * @param ids The tokenIds of the tokens being transferred.
316
+ * @param amounts The amounts of the tokens being transferred.
317
+ * @param data Any additional data being passed in the token transfer.
318
+ */
320
319
function _beforeTokenTransfer (
321
320
address operator ,
322
321
address from ,
@@ -370,11 +369,6 @@ contract ERC1155Drop is
370
369
return msg .sender == owner ();
371
370
}
372
371
373
- /// @dev Returns whether operator restriction can be set in the given execution context.
374
- function _canSetOperatorRestriction () internal virtual override returns (bool ) {
375
- return msg .sender == owner ();
376
- }
377
-
378
372
/// @dev Checks whether NFTs can be revealed in the given execution context.
379
373
function _canReveal () internal view virtual returns (bool ) {
380
374
return msg .sender == owner ();
0 commit comments