@@ -14,7 +14,6 @@ import "../extension/PrimarySale.sol";
1414import "../extension/DropSinglePhase1155.sol " ;
1515import "../extension/LazyMint.sol " ;
1616import "../extension/DelayedReveal.sol " ;
17- import "../extension/DefaultOperatorFilterer.sol " ;
1817
1918import "../lib/CurrencyTransferLib.sol " ;
2019import "../lib/TWStrings.sol " ;
@@ -52,8 +51,7 @@ contract ERC1155Drop is
5251 PrimarySale ,
5352 LazyMint ,
5453 DelayedReveal ,
55- DropSinglePhase1155 ,
56- DefaultOperatorFilterer
54+ DropSinglePhase1155
5755{
5856 using TWStrings for uint256 ;
5957
@@ -71,6 +69,16 @@ contract ERC1155Drop is
7169 Constructor
7270 //////////////////////////////////////////////////////////////*/
7371
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+ */
7482 constructor (
7583 address _defaultAdmin ,
7684 string memory _name ,
@@ -82,14 +90,16 @@ contract ERC1155Drop is
8290 _setupOwner (_defaultAdmin);
8391 _setupDefaultRoyaltyInfo (_royaltyRecipient, _royaltyBps);
8492 _setupPrimarySaleRecipient (_primarySaleRecipient);
85- _setOperatorRestriction (true );
8693 }
8794
8895 /*//////////////////////////////////////////////////////////////
8996 ERC165 Logic
9097 //////////////////////////////////////////////////////////////*/
9198
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+ */
93103 function supportsInterface (bytes4 interfaceId ) public view virtual override (ERC1155 , IERC165 ) returns (bool ) {
94104 return
95105 interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
@@ -151,10 +161,11 @@ contract ERC1155Drop is
151161 //////////////////////////////////////////////////////////////*/
152162
153163 /**
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.
156166 *
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.
158169 */
159170 function uri (uint256 _tokenId ) public view virtual override returns (string memory ) {
160171 (uint256 batchId , ) = _getBatchId (_tokenId);
@@ -174,8 +185,9 @@ contract ERC1155Drop is
174185 /**
175186 * @notice Lets an authorized address reveal a batch of delayed reveal NFTs.
176187 *
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.
179191 */
180192 function reveal (uint256 _index , bytes calldata _key ) public virtual override returns (string memory revealedURI ) {
181193 require (_canReveal (), "Not authorized " );
@@ -222,51 +234,15 @@ contract ERC1155Drop is
222234 return nextTokenIdToLazyMint;
223235 }
224236
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-
265237 /*///////////////////////////////////////////////////////////////
266238 Internal functions
267239 //////////////////////////////////////////////////////////////*/
268240
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+ */
270246 function _beforeClaim (
271247 uint256 _tokenId ,
272248 address ,
@@ -281,7 +257,15 @@ contract ERC1155Drop is
281257 }
282258 }
283259
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+
285269 function _collectPriceOnClaim (
286270 address _primarySaleRecipient ,
287271 uint256 _quantityToClaim ,
@@ -307,7 +291,13 @@ contract ERC1155Drop is
307291 CurrencyTransferLib.transferCurrency (_currency, msg .sender , saleRecipient, totalPrice);
308292 }
309293
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+ */
311301 function _transferTokensOnClaim (
312302 address _to ,
313303 uint256 _tokenId ,
@@ -316,7 +306,16 @@ contract ERC1155Drop is
316306 _mint (_to, _tokenId, _quantityBeingClaimed, "" );
317307 }
318308
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+ */
320319 function _beforeTokenTransfer (
321320 address operator ,
322321 address from ,
@@ -370,11 +369,6 @@ contract ERC1155Drop is
370369 return msg .sender == owner ();
371370 }
372371
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-
378372 /// @dev Checks whether NFTs can be revealed in the given execution context.
379373 function _canReveal () internal view virtual returns (bool ) {
380374 return msg .sender == owner ();
0 commit comments