diff --git a/contracts/base/ERC1155Base.sol b/contracts/base/ERC1155Base.sol index 15e7528ba..ec928f87e 100644 --- a/contracts/base/ERC1155Base.sol +++ b/contracts/base/ERC1155Base.sol @@ -10,7 +10,6 @@ import "../extension/Multicall.sol"; import "../extension/Ownable.sol"; import "../extension/Royalty.sol"; import "../extension/BatchMintMetadata.sol"; -import "../extension/DefaultOperatorFilterer.sol"; import "../lib/TWStrings.sol"; @@ -31,15 +30,7 @@ import "../lib/TWStrings.sol"; * - EIP 2981 compliance for royalty support on NFT marketplaces. */ -contract ERC1155Base is - ERC1155, - ContractMetadata, - Ownable, - Royalty, - Multicall, - BatchMintMetadata, - DefaultOperatorFilterer -{ +contract ERC1155Base is ERC1155, ContractMetadata, Ownable, Royalty, Multicall, BatchMintMetadata { using TWStrings for uint256; /*////////////////////////////////////////////////////////////// @@ -72,7 +63,6 @@ contract ERC1155Base is ) ERC1155(_name, _symbol) { _setupOwner(_defaultAdmin); _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps); - _setOperatorRestriction(true); } /*////////////////////////////////////////////////////////////// @@ -80,6 +70,8 @@ contract ERC1155Base is //////////////////////////////////////////////////////////////*/ /// @notice Returns the metadata URI for the given tokenId. + /// @param _tokenId The tokenId of the token for which a URI should be returned. + /// @return The metadata URI for the given tokenId. function uri(uint256 _tokenId) public view virtual override returns (string memory) { string memory uriForToken = _uri[_tokenId]; if (bytes(uriForToken).length > 0) { @@ -222,7 +214,10 @@ contract ERC1155Base is ERC165 Logic //////////////////////////////////////////////////////////////*/ - /// @notice Returns whether this contract supports the given interface. + /** + * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165 + * @inheritdoc IERC165 + */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, IERC165) returns (bool) { return interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165 @@ -240,76 +235,41 @@ contract ERC1155Base is return nextTokenIdToMint_; } - /*////////////////////////////////////////////////////////////// - ERC-1155 overrides - //////////////////////////////////////////////////////////////*/ - - /// @dev See {ERC1155-setApprovalForAll} - function setApprovalForAll(address operator, bool approved) - public - virtual - override(ERC1155) - onlyAllowedOperatorApproval(operator) - { - super.setApprovalForAll(operator, approved); - } - - /** - * @dev See {IERC1155-safeTransferFrom}. - */ - function safeTransferFrom( - address from, - address to, - uint256 id, - uint256 amount, - bytes memory data - ) public virtual override(ERC1155) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, id, amount, data); - } - - /** - * @dev See {IERC1155-safeBatchTransferFrom}. - */ - function safeBatchTransferFrom( - address from, - address to, - uint256[] memory ids, - uint256[] memory amounts, - bytes memory data - ) public virtual override(ERC1155) onlyAllowedOperator(from) { - super.safeBatchTransferFrom(from, to, ids, amounts, data); - } - /*////////////////////////////////////////////////////////////// Internal (overrideable) functions //////////////////////////////////////////////////////////////*/ /// @dev Returns whether contract metadata can be set in the given execution context. + /// @return Whether contract metadata can be set in the given execution context. function _canSetContractURI() internal view virtual override returns (bool) { return msg.sender == owner(); } /// @dev Returns whether a token can be minted in the given execution context. + /// @return Whether a token can be minted in the given execution context. function _canMint() internal view virtual returns (bool) { return msg.sender == owner(); } /// @dev Returns whether owner can be set in the given execution context. + /// @return Whether owner can be set in the given execution context. function _canSetOwner() internal view virtual override returns (bool) { return msg.sender == owner(); } /// @dev Returns whether royalty info can be set in the given execution context. + /// @return Whether royalty info can be set in the given execution context. function _canSetRoyaltyInfo() internal view virtual override returns (bool) { return msg.sender == owner(); } - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return msg.sender == owner(); - } - /// @dev Runs before every token transfer / mint / burn. + /// @param operator The address of the caller. + /// @param from The address of the sender. + /// @param to The address of the recipient. + /// @param ids The tokenIds of the tokens being transferred. + /// @param amounts The amounts of the tokens being transferred. + /// @param data Additional data with no specified format. function _beforeTokenTransfer( address operator, address from, diff --git a/contracts/base/ERC1155Drop.sol b/contracts/base/ERC1155Drop.sol index 88f127610..12a8af452 100644 --- a/contracts/base/ERC1155Drop.sol +++ b/contracts/base/ERC1155Drop.sol @@ -14,7 +14,6 @@ import "../extension/PrimarySale.sol"; import "../extension/DropSinglePhase1155.sol"; import "../extension/LazyMint.sol"; import "../extension/DelayedReveal.sol"; -import "../extension/DefaultOperatorFilterer.sol"; import "../lib/CurrencyTransferLib.sol"; import "../lib/TWStrings.sol"; @@ -52,8 +51,7 @@ contract ERC1155Drop is PrimarySale, LazyMint, DelayedReveal, - DropSinglePhase1155, - DefaultOperatorFilterer + DropSinglePhase1155 { using TWStrings for uint256; @@ -71,6 +69,16 @@ contract ERC1155Drop is Constructor //////////////////////////////////////////////////////////////*/ + /** + * @notice Initializes the contract with the given parameters. + * + * @param _defaultAdmin The default admin for the contract. + * @param _name The name of the contract. + * @param _symbol The symbol of the contract. + * @param _royaltyRecipient The address to which royalties should be sent. + * @param _royaltyBps The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%) + * @param _primarySaleRecipient The address to which primary sale revenue should be sent. + */ constructor( address _defaultAdmin, string memory _name, @@ -82,14 +90,16 @@ contract ERC1155Drop is _setupOwner(_defaultAdmin); _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps); _setupPrimarySaleRecipient(_primarySaleRecipient); - _setOperatorRestriction(true); } /*////////////////////////////////////////////////////////////// ERC165 Logic //////////////////////////////////////////////////////////////*/ - /// @notice Returns whether this contract supports the given interface. + /** + * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165 + * @inheritdoc IERC165 + */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, IERC165) returns (bool) { return interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165 @@ -151,10 +161,11 @@ contract ERC1155Drop is //////////////////////////////////////////////////////////////*/ /** - * @notice Returns the metadata URI for an NFT. - * @dev See `BatchMintMetadata` for handling of metadata in this contract. + * @notice Returns the metadata URI for an NFT. + * @dev See `BatchMintMetadata` for handling of metadata in this contract. * - * @param _tokenId The tokenId of an NFT. + * @param _tokenId The tokenId of an NFT. + * @return The metadata URI for the given NFT. */ function uri(uint256 _tokenId) public view virtual override returns (string memory) { (uint256 batchId, ) = _getBatchId(_tokenId); @@ -174,8 +185,9 @@ contract ERC1155Drop is /** * @notice Lets an authorized address reveal a batch of delayed reveal NFTs. * - * @param _index The ID for the batch of delayed-reveal NFTs to reveal. - * @param _key The key with which the base URI for the relevant batch of NFTs was encrypted. + * @param _index The ID for the batch of delayed-reveal NFTs to reveal. + * @param _key The key with which the base URI for the relevant batch of NFTs was encrypted. + * @return revealedURI The revealed URI for the batch of NFTs. */ function reveal(uint256 _index, bytes calldata _key) public virtual override returns (string memory revealedURI) { require(_canReveal(), "Not authorized"); @@ -222,51 +234,15 @@ contract ERC1155Drop is return nextTokenIdToLazyMint; } - /*////////////////////////////////////////////////////////////// - ERC-1155 overrides - //////////////////////////////////////////////////////////////*/ - - /// @dev See {ERC1155-setApprovalForAll} - function setApprovalForAll(address operator, bool approved) - public - virtual - override(ERC1155) - onlyAllowedOperatorApproval(operator) - { - super.setApprovalForAll(operator, approved); - } - - /** - * @dev See {IERC1155-safeTransferFrom}. - */ - function safeTransferFrom( - address from, - address to, - uint256 id, - uint256 amount, - bytes memory data - ) public virtual override(ERC1155) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, id, amount, data); - } - - /** - * @dev See {IERC1155-safeBatchTransferFrom}. - */ - function safeBatchTransferFrom( - address from, - address to, - uint256[] memory ids, - uint256[] memory amounts, - bytes memory data - ) public virtual override(ERC1155) onlyAllowedOperator(from) { - super.safeBatchTransferFrom(from, to, ids, amounts, data); - } - /*/////////////////////////////////////////////////////////////// Internal functions //////////////////////////////////////////////////////////////*/ - /// @dev Runs before every `claim` function call. + /** + * @dev Runs before every `claim` function call. + * + * @param _tokenId The tokenId of the NFT being claimed. + */ function _beforeClaim( uint256 _tokenId, address, @@ -281,7 +257,15 @@ contract ERC1155Drop is } } - /// @dev Collects and distributes the primary sale value of NFTs being claimed. + /** + * @dev Collects and distributes the primary sale value of NFTs being claimed. + * + * @param _primarySaleRecipient The address to which primary sale revenue should be sent. + * @param _quantityToClaim The quantity of NFTs being claimed. + * @param _currency The currency in which the NFTs are being sold. + * @param _pricePerToken The price per NFT being claimed. + */ + function _collectPriceOnClaim( address _primarySaleRecipient, uint256 _quantityToClaim, @@ -307,7 +291,13 @@ contract ERC1155Drop is CurrencyTransferLib.transferCurrency(_currency, msg.sender, saleRecipient, totalPrice); } - /// @dev Transfers the NFTs being claimed. + /** + * @dev Transfers the NFTs being claimed. + * + * @param _to The address to which the NFTs are being transferred. + * @param _tokenId The tokenId of the NFTs being claimed. + * @param _quantityBeingClaimed The quantity of NFTs being claimed. + */ function _transferTokensOnClaim( address _to, uint256 _tokenId, @@ -316,7 +306,16 @@ contract ERC1155Drop is _mint(_to, _tokenId, _quantityBeingClaimed, ""); } - /// @dev Runs before every token transfer / mint / burn. + /** + * @dev Runs before every token transfer / mint / burn. + * + * @param operator The address performing the token transfer. + * @param from The address from which the token is being transferred. + * @param to The address to which the token is being transferred. + * @param ids The tokenIds of the tokens being transferred. + * @param amounts The amounts of the tokens being transferred. + * @param data Any additional data being passed in the token transfer. + */ function _beforeTokenTransfer( address operator, address from, @@ -370,11 +369,6 @@ contract ERC1155Drop is return msg.sender == owner(); } - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return msg.sender == owner(); - } - /// @dev Checks whether NFTs can be revealed in the given execution context. function _canReveal() internal view virtual returns (bool) { return msg.sender == owner(); diff --git a/contracts/base/ERC1155LazyMint.sol b/contracts/base/ERC1155LazyMint.sol index 9f526a783..628c25ec2 100644 --- a/contracts/base/ERC1155LazyMint.sol +++ b/contracts/base/ERC1155LazyMint.sol @@ -12,7 +12,6 @@ import "../extension/Royalty.sol"; import "../extension/BatchMintMetadata.sol"; import "../extension/LazyMint.sol"; import "../extension/interface/IClaimableERC1155.sol"; -import "../extension/DefaultOperatorFilterer.sol"; import "../lib/TWStrings.sol"; import "../external-deps/openzeppelin/security/ReentrancyGuard.sol"; @@ -58,7 +57,6 @@ contract ERC1155LazyMint is BatchMintMetadata, LazyMint, IClaimableERC1155, - DefaultOperatorFilterer, ReentrancyGuard { using TWStrings for uint256; @@ -77,6 +75,15 @@ contract ERC1155LazyMint is Constructor //////////////////////////////////////////////////////////////*/ + /** + * @notice Initializes the contract during construction. + * + * @param _defaultAdmin The default admin of the contract. + * @param _name The name of the contract. + * @param _symbol The symbol of the contract. + * @param _royaltyRecipient The address to receive royalties. + * @param _royaltyBps The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%) + */ constructor( address _defaultAdmin, string memory _name, @@ -86,14 +93,18 @@ contract ERC1155LazyMint is ) ERC1155(_name, _symbol) { _setupOwner(_defaultAdmin); _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps); - _setOperatorRestriction(true); } /*////////////////////////////////////////////////////////////// Overriden metadata logic //////////////////////////////////////////////////////////////*/ - /// @notice Returns the metadata URI for the given tokenId. + /** + * @notice Returns the metadata URI for the given tokenId. + * + * @param _tokenId The tokenId of the NFT. + * @return The metadata URI for the given tokenId. + */ function uri(uint256 _tokenId) public view virtual override returns (string memory) { string memory batchUri = _getBaseURI(_tokenId); return string(abi.encodePacked(batchUri, _tokenId.toString())); @@ -195,7 +206,10 @@ contract ERC1155LazyMint is ERC165 Logic //////////////////////////////////////////////////////////////*/ - /// @notice Returns whether this contract supports the given interface. + /** + * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165 + * @inheritdoc IERC165 + */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, IERC165) returns (bool) { return interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165 @@ -213,46 +227,6 @@ contract ERC1155LazyMint is return nextTokenIdToLazyMint; } - /*////////////////////////////////////////////////////////////// - ERC-1155 overrides - //////////////////////////////////////////////////////////////*/ - - /// @dev See {ERC1155-setApprovalForAll} - function setApprovalForAll(address operator, bool approved) - public - virtual - override(ERC1155) - onlyAllowedOperatorApproval(operator) - { - super.setApprovalForAll(operator, approved); - } - - /** - * @dev See {IERC1155-safeTransferFrom}. - */ - function safeTransferFrom( - address from, - address to, - uint256 id, - uint256 amount, - bytes memory data - ) public virtual override(ERC1155) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, id, amount, data); - } - - /** - * @dev See {IERC1155-safeBatchTransferFrom}. - */ - function safeBatchTransferFrom( - address from, - address to, - uint256[] memory ids, - uint256[] memory amounts, - bytes memory data - ) public virtual override(ERC1155) onlyAllowedOperator(from) { - super.safeBatchTransferFrom(from, to, ids, amounts, data); - } - /*////////////////////////////////////////////////////////////// Internal functions //////////////////////////////////////////////////////////////*/ @@ -264,6 +238,10 @@ contract ERC1155LazyMint is * * @dev Override this function to add logic for state updation. * When overriding, apply any state changes before `_mint`. + * + * @param _receiver The receiver of the tokens to mint. + * @param _tokenId The tokenId of the lazy minted NFT to mint. + * @param _quantity The number of tokens to mint. */ function _transferTokensOnClaim( address _receiver, @@ -293,12 +271,16 @@ contract ERC1155LazyMint is return msg.sender == owner(); } - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return msg.sender == owner(); - } - - /// @dev Runs before every token transfer / mint / burn. + /** + * @dev Runs before every token transfer / mint / burn. + * + * @param operator The address performing the token transfer. + * @param from The address from which the token is being transferred. + * @param to The address to which the token is being transferred. + * @param ids The tokenIds of the tokens being transferred. + * @param amounts The amounts of the tokens being transferred. + * @param data Any additional data being passed in the token transfer. + */ function _beforeTokenTransfer( address operator, address from, diff --git a/contracts/base/ERC721Base.sol b/contracts/base/ERC721Base.sol index fa4449f11..bd6123979 100644 --- a/contracts/base/ERC721Base.sol +++ b/contracts/base/ERC721Base.sol @@ -10,7 +10,6 @@ import "../extension/Multicall.sol"; import "../extension/Ownable.sol"; import "../extension/Royalty.sol"; import "../extension/BatchMintMetadata.sol"; -import "../extension/DefaultOperatorFilterer.sol"; import "../lib/TWStrings.sol"; @@ -31,15 +30,7 @@ import "../lib/TWStrings.sol"; * - EIP 2981 compliance for royalty support on NFT marketplaces. */ -contract ERC721Base is - ERC721A, - ContractMetadata, - Multicall, - Ownable, - Royalty, - BatchMintMetadata, - DefaultOperatorFilterer -{ +contract ERC721Base is ERC721A, ContractMetadata, Multicall, Ownable, Royalty, BatchMintMetadata { using TWStrings for uint256; /*////////////////////////////////////////////////////////////// @@ -52,6 +43,15 @@ contract ERC721Base is Constructor //////////////////////////////////////////////////////////////*/ + /** + * @notice Initializes the contract during construction. + * + * @param _defaultAdmin The default admin of the contract. + * @param _name The name of the contract. + * @param _symbol The symbol of the contract. + * @param _royaltyRecipient The address to receive royalties. + * @param _royaltyBps The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%) + */ constructor( address _defaultAdmin, string memory _name, @@ -61,14 +61,16 @@ contract ERC721Base is ) ERC721A(_name, _symbol) { _setupOwner(_defaultAdmin); _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps); - _setOperatorRestriction(true); } /*////////////////////////////////////////////////////////////// ERC165 Logic //////////////////////////////////////////////////////////////*/ - /// @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165 + /** + * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165 + * @inheritdoc IERC165 + */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC165) returns (bool) { return interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165 @@ -153,7 +155,14 @@ contract ERC721Base is return _currentIndex; } - /// @notice Returns whether a given address is the owner, or approved to transfer an NFT. + /** + * @notice Returns whether a given address is the owner, or approved to transfer an NFT. + * + * @param _operator The address to check. + * @param _tokenId The tokenId of the NFT to check. + * + * @return isApprovedOrOwnerOf Whether the given address is approved to transfer the given NFT. + */ function isApprovedOrOwner(address _operator, uint256 _tokenId) public view @@ -166,62 +175,16 @@ contract ERC721Base is getApproved(_tokenId) == _operator); } - /*////////////////////////////////////////////////////////////// - ERC-721 overrides - //////////////////////////////////////////////////////////////*/ - - /// @dev See {ERC721-setApprovalForAll}. - function setApprovalForAll(address operator, bool approved) - public - virtual - override(ERC721A) - onlyAllowedOperatorApproval(operator) - { - super.setApprovalForAll(operator, approved); - } - - /// @dev See {ERC721-approve}. - function approve(address operator, uint256 tokenId) - public - virtual - override(ERC721A) - onlyAllowedOperatorApproval(operator) - { - super.approve(operator, tokenId); - } - - /// @dev See {ERC721-_transferFrom}. - function transferFrom( - address from, - address to, - uint256 tokenId - ) public virtual override(ERC721A) onlyAllowedOperator(from) { - super.transferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public virtual override(ERC721A) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public virtual override(ERC721A) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId, data); - } - /*////////////////////////////////////////////////////////////// Internal (overrideable) functions //////////////////////////////////////////////////////////////*/ + /** + * @notice Sets the metadata URI for a given tokenId. + * + * @param _tokenId The tokenId of the NFT to set the URI for. + * @param _tokenURI The URI to set for the given tokenId. + */ function _setTokenURI(uint256 _tokenId, string memory _tokenURI) internal virtual { require(bytes(fullURI[_tokenId]).length == 0, "URI already set"); fullURI[_tokenId] = _tokenURI; @@ -246,9 +209,4 @@ contract ERC721Base is function _canSetRoyaltyInfo() internal view virtual override returns (bool) { return msg.sender == owner(); } - - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return msg.sender == owner(); - } } diff --git a/contracts/base/ERC721Drop.sol b/contracts/base/ERC721Drop.sol index 8ba76f855..60fd84dc2 100644 --- a/contracts/base/ERC721Drop.sol +++ b/contracts/base/ERC721Drop.sol @@ -14,7 +14,6 @@ import "../extension/PrimarySale.sol"; import "../extension/DropSinglePhase.sol"; import "../extension/LazyMint.sol"; import "../extension/DelayedReveal.sol"; -import "../extension/DefaultOperatorFilterer.sol"; import "../lib/TWStrings.sol"; import "../lib/CurrencyTransferLib.sol"; @@ -52,7 +51,6 @@ contract ERC721Drop is PrimarySale, LazyMint, DelayedReveal, - DefaultOperatorFilterer, DropSinglePhase { using TWStrings for uint256; @@ -61,6 +59,16 @@ contract ERC721Drop is Constructor //////////////////////////////////////////////////////////////*/ + /** + * @notice Initializes the contract during construction. + * + * @param _defaultAdmin The default admin of the contract. + * @param _name The name of the contract. + * @param _symbol The symbol of the contract. + * @param _royaltyRecipient The address to receive royalties. + * @param _royaltyBps The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%) + * @param _primarySaleRecipient The address to receive primary sale value. + */ constructor( address _defaultAdmin, string memory _name, @@ -72,14 +80,16 @@ contract ERC721Drop is _setupOwner(_defaultAdmin); _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps); _setupPrimarySaleRecipient(_primarySaleRecipient); - _setOperatorRestriction(true); } /*////////////////////////////////////////////////////////////// ERC165 Logic //////////////////////////////////////////////////////////////*/ - /// @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165 + /** + * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165 + * @inheritdoc IERC165 + */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC165) returns (bool) { return interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165 @@ -183,63 +193,15 @@ contract ERC721Drop is _burn(_tokenId, true); } - /*////////////////////////////////////////////////////////////// - ERC-721 overrides - //////////////////////////////////////////////////////////////*/ - - /// @dev See {ERC721-setApprovalForAll}. - function setApprovalForAll(address operator, bool approved) - public - virtual - override(ERC721A) - onlyAllowedOperatorApproval(operator) - { - super.setApprovalForAll(operator, approved); - } - - /// @dev See {ERC721-approve}. - function approve(address operator, uint256 tokenId) - public - virtual - override(ERC721A) - onlyAllowedOperatorApproval(operator) - { - super.approve(operator, tokenId); - } - - /// @dev See {ERC721-_transferFrom}. - function transferFrom( - address from, - address to, - uint256 tokenId - ) public virtual override(ERC721A) onlyAllowedOperator(from) { - super.transferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public virtual override(ERC721A) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public virtual override(ERC721A) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId, data); - } - /*/////////////////////////////////////////////////////////////// Internal functions //////////////////////////////////////////////////////////////*/ - /// @dev Runs before every `claim` function call. + /** + * @dev Runs before every `claim` function call. + * + * @param _quantity The quantity of NFTs being claimed. + */ function _beforeClaim( address, uint256 _quantity, @@ -253,7 +215,14 @@ contract ERC721Drop is } } - /// @dev Collects and distributes the primary sale value of NFTs being claimed. + /** + * @dev Collects and distributes the primary sale value of NFTs being claimed. + * + * @param _primarySaleRecipient The address to receive the primary sale value. + * @param _quantityToClaim The quantity of NFTs being claimed. + * @param _currency The currency in which the NFTs are being claimed. + * @param _pricePerToken The price per token in the given currency. + */ function _collectPriceOnClaim( address _primarySaleRecipient, uint256 _quantityToClaim, @@ -279,7 +248,12 @@ contract ERC721Drop is CurrencyTransferLib.transferCurrency(_currency, msg.sender, saleRecipient, totalPrice); } - /// @dev Transfers the NFTs being claimed. + /** + * @dev Transfers the NFTs being claimed. + * + * @param _to The address to which the NFTs are being transferred. + * @param _quantityBeingClaimed The quantity of NFTs being claimed. + */ function _transferTokensOnClaim(address _to, uint256 _quantityBeingClaimed) internal virtual @@ -325,11 +299,6 @@ contract ERC721Drop is return msg.sender == owner(); } - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return msg.sender == owner(); - } - /*/////////////////////////////////////////////////////////////// Miscellaneous //////////////////////////////////////////////////////////////*/ diff --git a/contracts/base/ERC721LazyMint.sol b/contracts/base/ERC721LazyMint.sol index 37dbdf399..4d18a2a88 100644 --- a/contracts/base/ERC721LazyMint.sol +++ b/contracts/base/ERC721LazyMint.sol @@ -12,7 +12,6 @@ import "../extension/Royalty.sol"; import "../extension/BatchMintMetadata.sol"; import "../extension/LazyMint.sol"; import "../extension/interface/IClaimableERC721.sol"; -import "../extension/DefaultOperatorFilterer.sol"; import "../lib/TWStrings.sol"; import "../external-deps/openzeppelin/security/ReentrancyGuard.sol"; @@ -52,7 +51,6 @@ contract ERC721LazyMint is BatchMintMetadata, LazyMint, IClaimableERC721, - DefaultOperatorFilterer, ReentrancyGuard { using TWStrings for uint256; @@ -61,6 +59,15 @@ contract ERC721LazyMint is Constructor //////////////////////////////////////////////////////////////*/ + /** + * @notice Initializes the contract during construction. + * + * @param _defaultAdmin The default admin of the contract. + * @param _name The name of the contract. + * @param _symbol The symbol of the contract. + * @param _royaltyRecipient The address to receive royalties. + * @param _royaltyBps The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%) + */ constructor( address _defaultAdmin, string memory _name, @@ -70,14 +77,16 @@ contract ERC721LazyMint is ) ERC721A(_name, _symbol) { _setupOwner(_defaultAdmin); _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps); - _setOperatorRestriction(true); } /*////////////////////////////////////////////////////////////// ERC165 Logic //////////////////////////////////////////////////////////////*/ - /// @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165 + /** + * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165 + * @inheritdoc IERC165 + */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC165) returns (bool) { return interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165 @@ -109,11 +118,10 @@ contract ERC721LazyMint is * @notice Lets an address claim multiple lazy minted NFTs at once to a recipient. * This function prevents any reentrant calls, and is not allowed to be overridden. * - * Contract creators should override `verifyClaim` and `transferTokensOnClaim` + * @dev Contract creators should override `verifyClaim` and `transferTokensOnClaim` * functions to create custom logic for verification and claiming, * for e.g. price collection, allowlist, max quantity, etc. - * - * @dev The logic in `verifyClaim` determines whether the caller is authorized to mint NFTs. + * The logic in `verifyClaim` determines whether the caller is authorized to mint NFTs. * The logic in `transferTokensOnClaim` does actual minting of tokens, * can also be used to apply other state changes. * @@ -129,10 +137,10 @@ contract ERC721LazyMint is } /** - * @notice Override this function to add logic for claim verification, based on conditions - * such as allowlist, price, max quantity etc. + * @notice Checks a request to claim NFTs against a custom condition. * - * @dev Checks a request to claim NFTs against a custom condition. + * @dev Override this function to add logic for claim verification, based on conditions + * such as allowlist, price, max quantity etc. * * @param _claimer Caller of the claim function. * @param _quantity The number of NFTs being claimed. @@ -159,58 +167,6 @@ contract ERC721LazyMint is return _currentIndex; } - /*////////////////////////////////////////////////////////////// - ERC-721 overrides - //////////////////////////////////////////////////////////////*/ - - /// @dev See {ERC721-setApprovalForAll}. - function setApprovalForAll(address operator, bool approved) - public - virtual - override(ERC721A) - onlyAllowedOperatorApproval(operator) - { - super.setApprovalForAll(operator, approved); - } - - /// @dev See {ERC721-approve}. - function approve(address operator, uint256 tokenId) - public - virtual - override(ERC721A) - onlyAllowedOperatorApproval(operator) - { - super.approve(operator, tokenId); - } - - /// @dev See {ERC721-_transferFrom}. - function transferFrom( - address from, - address to, - uint256 tokenId - ) public virtual override(ERC721A) onlyAllowedOperator(from) { - super.transferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public virtual override(ERC721A) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public virtual override(ERC721A) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId, data); - } - /*////////////////////////////////////////////////////////////// Internal functions //////////////////////////////////////////////////////////////*/ @@ -222,6 +178,11 @@ contract ERC721LazyMint is * * @dev Override this function to add logic for state updation. * When overriding, apply any state changes before `_safeMint`. + * + * @param _receiver The recipient of the NFT to mint. + * @param _quantity The number of NFTs to mint. + * + * @return startTokenId The tokenId of the first NFT minted. */ function _transferTokensOnClaim(address _receiver, uint256 _quantity) internal @@ -251,9 +212,4 @@ contract ERC721LazyMint is function _canSetRoyaltyInfo() internal view virtual override returns (bool) { return msg.sender == owner(); } - - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return msg.sender == owner(); - } } diff --git a/contracts/base/ERC721Multiwrap.sol b/contracts/base/ERC721Multiwrap.sol index 9bf481d59..62adb6a99 100644 --- a/contracts/base/ERC721Multiwrap.sol +++ b/contracts/base/ERC721Multiwrap.sol @@ -11,7 +11,6 @@ import "../extension/Royalty.sol"; import "../extension/SoulboundERC721A.sol"; import "../extension/TokenStore.sol"; import "../extension/Multicall.sol"; -import "../extension/DefaultOperatorFilterer.sol"; /** * BASE: ERC721Base @@ -27,16 +26,7 @@ import "../extension/DefaultOperatorFilterer.sol"; * */ -contract ERC721Multiwrap is - Multicall, - TokenStore, - SoulboundERC721A, - ERC721A, - ContractMetadata, - Ownable, - Royalty, - DefaultOperatorFilterer -{ +contract ERC721Multiwrap is Multicall, TokenStore, SoulboundERC721A, ERC721A, ContractMetadata, Ownable, Royalty { /*////////////////////////////////////////////////////////////// Permission control roles //////////////////////////////////////////////////////////////*/ @@ -81,6 +71,16 @@ contract ERC721Multiwrap is Constructor //////////////////////////////////////////////////////////////*/ + /** + * @notice Initializes the contract during construction. + * + * @param _defaultAdmin The default admin of the contract. + * @param _name The name of the contract. + * @param _symbol The symbol of the contract. + * @param _royaltyRecipient The address to receive royalties. + * @param _royaltyBps The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%) + * @param _nativeTokenWrapper The address of the ERC20 wrapper for the native token. + */ constructor( address _defaultAdmin, string memory _name, @@ -91,7 +91,6 @@ contract ERC721Multiwrap is ) ERC721A(_name, _symbol) TokenStore(_nativeTokenWrapper) { _setupOwner(_defaultAdmin); _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps); - _setOperatorRestriction(true); _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin); _setupRole(MINTER_ROLE, _defaultAdmin); @@ -107,7 +106,10 @@ contract ERC721Multiwrap is Public gette functions //////////////////////////////////////////////////////////////*/ - /// @dev See ERC-165 + /** + * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165 + * @inheritdoc IERC165 + */ function supportsInterface(bytes4 interfaceId) public view @@ -191,7 +193,14 @@ contract ERC721Multiwrap is return _currentIndex; } - /// @notice Returns whether a given address is the owner, or approved to transfer an NFT. + /** + * @notice Returns whether a given address is the owner, or approved to transfer an NFT. + * + * @param _operator The address to check. + * @param _tokenId The tokenId to check. + * + * @return isApprovedOrOwnerOf Whether `_operator` is approved to transfer `_tokenId`. + */ function isApprovedOrOwner(address _operator, uint256 _tokenId) public view @@ -204,63 +213,14 @@ contract ERC721Multiwrap is getApproved(_tokenId) == _operator); } - /*////////////////////////////////////////////////////////////// - ERC-721 overrides - //////////////////////////////////////////////////////////////*/ - - /// @dev See {ERC721-setApprovalForAll}. - function setApprovalForAll(address operator, bool approved) - public - virtual - override(ERC721A) - onlyAllowedOperatorApproval(operator) - { - super.setApprovalForAll(operator, approved); - } - - /// @dev See {ERC721-approve}. - function approve(address operator, uint256 tokenId) - public - virtual - override(ERC721A) - onlyAllowedOperatorApproval(operator) - { - super.approve(operator, tokenId); - } - - /// @dev See {ERC721-_transferFrom}. - function transferFrom( - address from, - address to, - uint256 tokenId - ) public virtual override(ERC721A) onlyAllowedOperator(from) { - super.transferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public virtual override(ERC721A) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public virtual override(ERC721A) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId, data); - } - /*/////////////////////////////////////////////////////////////// Internal functions //////////////////////////////////////////////////////////////*/ - /// @dev See {ERC721-_beforeTokenTransfer}. + /** + * @dev See {ERC721-_beforeTokenTransfer}. + * @inheritdoc ERC721A + */ function _beforeTokenTransfers( address from, address to, @@ -290,9 +250,4 @@ contract ERC721Multiwrap is function _canSetRoyaltyInfo() internal view virtual override returns (bool) { return msg.sender == owner(); } - - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return msg.sender == owner(); - } } diff --git a/contracts/extension/DefaultOperatorFilterer.sol b/contracts/extension/DefaultOperatorFilterer.sol deleted file mode 100644 index a3b69aa54..000000000 --- a/contracts/extension/DefaultOperatorFilterer.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: Apache 2.0 -pragma solidity ^0.8.0; - -/// @author thirdweb - -import { OperatorFilterer } from "./OperatorFilterer.sol"; - -/** - * @title DefaultOperatorFilterer - * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription. - */ -abstract contract DefaultOperatorFilterer is OperatorFilterer { - address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); - - constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {} - - function subscribeToRegistry(address _subscription) external { - require(_canSetOperatorRestriction(), "Not authorized to subscribe to registry."); - _register(_subscription, true); - } -} diff --git a/contracts/extension/DefaultOperatorFiltererUpgradeable.sol b/contracts/extension/DefaultOperatorFiltererUpgradeable.sol deleted file mode 100644 index 49d13df8f..000000000 --- a/contracts/extension/DefaultOperatorFiltererUpgradeable.sol +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: Apache 2.0 -pragma solidity ^0.8.0; - -/// @author thirdweb - -import { OperatorFiltererUpgradeable } from "./OperatorFiltererUpgradeable.sol"; - -abstract contract DefaultOperatorFiltererUpgradeable is OperatorFiltererUpgradeable { - address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); - - function __DefaultOperatorFilterer_init() internal { - OperatorFiltererUpgradeable.__OperatorFilterer_init(DEFAULT_SUBSCRIPTION, true); - } - - function subscribeToRegistry(address _subscription) external { - require(_canSetOperatorRestriction(), "Not authorized to subscribe to registry."); - _register(_subscription, true); - } -} diff --git a/contracts/extension/upgradeable/DefaultOperatorFiltererUpgradeable.sol b/contracts/extension/upgradeable/DefaultOperatorFiltererUpgradeable.sol deleted file mode 100644 index 48d730468..000000000 --- a/contracts/extension/upgradeable/DefaultOperatorFiltererUpgradeable.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: Apache 2.0 -pragma solidity ^0.8.0; - -/// @author thirdweb - -import { OperatorFiltererUpgradeable } from "./OperatorFiltererUpgradeable.sol"; - -abstract contract DefaultOperatorFiltererUpgradeable is OperatorFiltererUpgradeable { - address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); - - function __DefaultOperatorFilterer_init() internal { - OperatorFiltererUpgradeable.__OperatorFilterer_init(DEFAULT_SUBSCRIPTION, true); - } -} diff --git a/contracts/extension/upgradeable/init/DefaultOperatorFiltererInit.sol b/contracts/extension/upgradeable/init/DefaultOperatorFiltererInit.sol deleted file mode 100644 index 963332486..000000000 --- a/contracts/extension/upgradeable/init/DefaultOperatorFiltererInit.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.0; - -import "../../interface/IOperatorFilterRegistry.sol"; -import { OperatorFilterToggleStorage } from "../OperatorFilterToggle.sol"; - -contract DefaultOperatorFiltererInit { - event OperatorRestriction(bool restriction); - - IOperatorFilterRegistry constant OPERATOR_FILTER_REGISTRY = - IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); - - address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); - - function _setupOperatorFilterer() internal { - __DefaultOperatorFilterer_init(); - } - - function __DefaultOperatorFilterer_init() private { - __OperatorFilterer_init(DEFAULT_SUBSCRIPTION, true); - - OperatorFilterToggleStorage.Data storage data = OperatorFilterToggleStorage.data(); - data.operatorRestriction = true; - - emit OperatorRestriction(true); - } - - function __OperatorFilterer_init(address subscriptionOrRegistrantToCopy, bool subscribe) private { - // If an inheriting token contract is deployed to a network without the registry deployed, the modifier - // will not revert, but the contract will need to be registered with the registry once it is deployed in - // order for the modifier to filter addresses. - if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { - if (!OPERATOR_FILTER_REGISTRY.isRegistered(address(this))) { - if (subscribe) { - OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); - } else { - if (subscriptionOrRegistrantToCopy != address(0)) { - OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); - } else { - OPERATOR_FILTER_REGISTRY.register(address(this)); - } - } - } - } - } -} diff --git a/contracts/prebuilts/drop/DropERC1155.sol b/contracts/prebuilts/drop/DropERC1155.sol index 0915d7380..4f6db9b1d 100644 --- a/contracts/prebuilts/drop/DropERC1155.sol +++ b/contracts/prebuilts/drop/DropERC1155.sol @@ -36,9 +36,6 @@ import "../../extension/LazyMint.sol"; import "../../extension/PermissionsEnumerable.sol"; import "../../extension/Drop1155.sol"; -// OpenSea operator filter -import "../../extension/DefaultOperatorFiltererUpgradeable.sol"; - contract DropERC1155 is Initializable, ContractMetadata, @@ -51,7 +48,6 @@ contract DropERC1155 is Drop1155, ERC2771ContextUpgradeable, MulticallUpgradeable, - DefaultOperatorFiltererUpgradeable, ERC1155Upgradeable { using StringsUpgradeable for uint256; @@ -122,12 +118,10 @@ contract DropERC1155 is // Initialize inherited contracts, most base-like -> most derived. __ERC2771Context_init(_trustedForwarders); __ERC1155_init_unchained(""); - __DefaultOperatorFilterer_init(); // Initialize this contract's state. _setupContractURI(_contractURI); _setupOwner(_defaultAdmin); - _setOperatorRestriction(true); _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin); _setupRole(_minterRole, _defaultAdmin); @@ -291,11 +285,6 @@ contract DropERC1155 is return hasRole(minterRole, _msgSender()); } - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); - } - /*/////////////////////////////////////////////////////////////// Miscellaneous //////////////////////////////////////////////////////////////*/ @@ -350,37 +339,6 @@ contract DropERC1155 is } } - /// @dev See {ERC1155-setApprovalForAll} - function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { - super.setApprovalForAll(operator, approved); - } - - /** - * @dev See {IERC1155-safeTransferFrom}. - */ - function safeTransferFrom( - address from, - address to, - uint256 id, - uint256 amount, - bytes memory data - ) public override(ERC1155Upgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, id, amount, data); - } - - /** - * @dev See {IERC1155-safeBatchTransferFrom}. - */ - function safeBatchTransferFrom( - address from, - address to, - uint256[] memory ids, - uint256[] memory amounts, - bytes memory data - ) public override(ERC1155Upgradeable) onlyAllowedOperator(from) { - super.safeBatchTransferFrom(from, to, ids, amounts, data); - } - function _dropMsgSender() internal view virtual override returns (address) { return _msgSender(); } diff --git a/contracts/prebuilts/drop/DropERC721.sol b/contracts/prebuilts/drop/DropERC721.sol index 382467b53..1f2961120 100644 --- a/contracts/prebuilts/drop/DropERC721.sol +++ b/contracts/prebuilts/drop/DropERC721.sol @@ -37,9 +37,6 @@ import "../../extension/LazyMint.sol"; import "../../extension/PermissionsEnumerable.sol"; import "../../extension/Drop.sol"; -// OpenSea operator filter -import "../../extension/DefaultOperatorFiltererUpgradeable.sol"; - contract DropERC721 is Initializable, ContractMetadata, @@ -53,7 +50,6 @@ contract DropERC721 is Drop, ERC2771ContextUpgradeable, MulticallUpgradeable, - DefaultOperatorFiltererUpgradeable, ERC721AUpgradeable { using StringsUpgradeable for uint256; @@ -101,11 +97,9 @@ contract DropERC721 is // Initialize inherited contracts, most base-like -> most derived. __ERC2771Context_init(_trustedForwarders); __ERC721A_init(_name, _symbol); - __DefaultOperatorFilterer_init(); _setupContractURI(_contractURI); _setupOwner(_defaultAdmin); - _setOperatorRestriction(true); _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin); _setupRole(_minterRole, _defaultAdmin); @@ -300,11 +294,6 @@ contract DropERC721 is return hasRole(minterRole, _msgSender()); } - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); - } - /*/////////////////////////////////////////////////////////////// Miscellaneous //////////////////////////////////////////////////////////////*/ @@ -351,44 +340,6 @@ contract DropERC721 is } } - /// @dev See {ERC721-setApprovalForAll}. - function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { - super.setApprovalForAll(operator, approved); - } - - /// @dev See {ERC721-approve}. - function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) { - super.approve(operator, tokenId); - } - - /// @dev See {ERC721-_transferFrom}. - function transferFrom( - address from, - address to, - uint256 tokenId - ) public override(ERC721AUpgradeable) onlyAllowedOperator(from) { - super.transferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public override(ERC721AUpgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public override(ERC721AUpgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId, data); - } - function _dropMsgSender() internal view virtual override returns (address) { return _msgSender(); } diff --git a/contracts/prebuilts/loyalty/LoyaltyCard.sol b/contracts/prebuilts/loyalty/LoyaltyCard.sol index 486f83e2b..0ff5fc2b8 100644 --- a/contracts/prebuilts/loyalty/LoyaltyCard.sol +++ b/contracts/prebuilts/loyalty/LoyaltyCard.sol @@ -31,7 +31,6 @@ import "../../extension/PrimarySale.sol"; import "../../extension/PlatformFee.sol"; import "../../extension/Multicall.sol"; import "../../extension/PermissionsEnumerable.sol"; -import "../../extension/DefaultOperatorFiltererUpgradeable.sol"; import "../../external-deps/openzeppelin/metatx/ERC2771ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; @@ -53,7 +52,6 @@ contract LoyaltyCard is Multicall, PermissionsEnumerable, ReentrancyGuardUpgradeable, - DefaultOperatorFiltererUpgradeable, ERC2771ContextUpgradeable, NFTMetadata, SignatureMintERC721Upgradeable, @@ -97,13 +95,11 @@ contract LoyaltyCard is // Initialize inherited contracts, most base-like -> most derived. __ERC2771Context_init(_trustedForwarders); __ERC721A_init(_name, _symbol); - __DefaultOperatorFilterer_init(); __SignatureMintERC721_init(); __ReentrancyGuard_init(); _setupContractURI(_contractURI); _setupOwner(_defaultAdmin); - _setOperatorRestriction(true); _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin); _setupRole(MINTER_ROLE, _defaultAdmin); @@ -184,48 +180,6 @@ contract LoyaltyCard is _burn(tokenId); } - /*/////////////////////////////////////////////////////////////// - Operator filter overrides - //////////////////////////////////////////////////////////////*/ - - /// @dev See {ERC721-setApprovalForAll}. - function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { - super.setApprovalForAll(operator, approved); - } - - /// @dev See {ERC721-approve}. - function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) { - super.approve(operator, tokenId); - } - - /// @dev See {ERC721-_transferFrom}. - function transferFrom( - address from, - address to, - uint256 tokenId - ) public override(ERC721AUpgradeable) onlyAllowedOperator(from) { - super.transferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public override(ERC721AUpgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public override(ERC721AUpgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId, data); - } - /*/////////////////////////////////////////////////////////////// Miscellaneous //////////////////////////////////////////////////////////////*/ @@ -355,11 +309,6 @@ contract LoyaltyCard is return hasRole(METADATA_ROLE, _msgSender()); } - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); - } - function _msgSender() internal view diff --git a/contracts/prebuilts/open-edition/OpenEditionERC721.sol b/contracts/prebuilts/open-edition/OpenEditionERC721.sol index d6b7dfb3a..f1788c744 100644 --- a/contracts/prebuilts/open-edition/OpenEditionERC721.sol +++ b/contracts/prebuilts/open-edition/OpenEditionERC721.sol @@ -35,9 +35,6 @@ import "../../extension/SharedMetadata.sol"; import "../../extension/PermissionsEnumerable.sol"; import "../../extension/Drop.sol"; -// OpenSea operator filter -import "../../extension/DefaultOperatorFiltererUpgradeable.sol"; - contract OpenEditionERC721 is Initializable, ContractMetadata, @@ -49,7 +46,6 @@ contract OpenEditionERC721 is Drop, ERC2771ContextUpgradeable, Multicall, - DefaultOperatorFiltererUpgradeable, ERC721AQueryableUpgradeable { using StringsUpgradeable for uint256; @@ -89,11 +85,9 @@ contract OpenEditionERC721 is // Initialize inherited contracts, most base-like -> most derived. __ERC2771Context_init(_trustedForwarders); __ERC721A_init(_name, _symbol); - __DefaultOperatorFilterer_init(); _setupContractURI(_contractURI); _setupOwner(_defaultAdmin); - _setOperatorRestriction(true); _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin); _setupRole(_minterRole, _defaultAdmin); @@ -217,11 +211,6 @@ contract OpenEditionERC721 is return hasRole(minterRole, _msgSender()); } - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); - } - /*/////////////////////////////////////////////////////////////// Miscellaneous //////////////////////////////////////////////////////////////*/ @@ -268,53 +257,6 @@ contract OpenEditionERC721 is } } - /// @dev See {ERC721-setApprovalForAll}. - function setApprovalForAll(address operator, bool approved) - public - override(IERC721AUpgradeable, ERC721AUpgradeable) - onlyAllowedOperatorApproval(operator) - { - super.setApprovalForAll(operator, approved); - } - - /// @dev See {ERC721-approve}. - function approve(address operator, uint256 tokenId) - public - payable - override(ERC721AUpgradeable, IERC721AUpgradeable) - onlyAllowedOperatorApproval(operator) - { - super.approve(operator, tokenId); - } - - /// @dev See {ERC721-_transferFrom}. - function transferFrom( - address from, - address to, - uint256 tokenId - ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { - super.transferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId, data); - } - function _dropMsgSender() internal view virtual override returns (address) { return _msgSender(); } diff --git a/contracts/prebuilts/token/TokenERC1155.sol b/contracts/prebuilts/token/TokenERC1155.sol index d26aa0eaf..8a8939295 100644 --- a/contracts/prebuilts/token/TokenERC1155.sol +++ b/contracts/prebuilts/token/TokenERC1155.sol @@ -44,9 +44,6 @@ import "../../external-deps/openzeppelin/metatx/ERC2771ContextUpgradeable.sol"; // Helper interfaces import "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol"; -// OpenSea operator filter -import "../../extension/DefaultOperatorFiltererUpgradeable.sol"; - contract TokenERC1155 is Initializable, IThirdwebContract, @@ -59,7 +56,6 @@ contract TokenERC1155 is ERC2771ContextUpgradeable, MulticallUpgradeable, AccessControlEnumerableUpgradeable, - DefaultOperatorFiltererUpgradeable, ERC1155Upgradeable, ITokenERC1155, NFTMetadata @@ -153,10 +149,8 @@ contract TokenERC1155 is __EIP712_init("TokenERC1155", "1"); __ERC2771Context_init(_trustedForwarders); __ERC1155_init(""); - __DefaultOperatorFilterer_init(); // Initialize this contract's state. - _setOperatorRestriction(true); name = _name; symbol = _symbol; royaltyRecipient = _royaltyRecipient; @@ -536,41 +530,6 @@ contract TokenERC1155 is } } - /// @dev See {ERC1155-setApprovalForAll} - function setApprovalForAll(address operator, bool approved) - public - override(ERC1155Upgradeable, IERC1155Upgradeable) - onlyAllowedOperatorApproval(operator) - { - super.setApprovalForAll(operator, approved); - } - - /** - * @dev See {IERC1155-safeTransferFrom}. - */ - function safeTransferFrom( - address from, - address to, - uint256 id, - uint256 amount, - bytes memory data - ) public override(ERC1155Upgradeable, IERC1155Upgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, id, amount, data); - } - - /** - * @dev See {IERC1155-safeBatchTransferFrom}. - */ - function safeBatchTransferFrom( - address from, - address to, - uint256[] memory ids, - uint256[] memory amounts, - bytes memory data - ) public override(ERC1155Upgradeable, IERC1155Upgradeable) onlyAllowedOperator(from) { - super.safeBatchTransferFrom(from, to, ids, amounts, data); - } - function supportsInterface(bytes4 interfaceId) public view @@ -584,11 +543,6 @@ contract TokenERC1155 is interfaceId == type(IERC2981Upgradeable).interfaceId; } - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); - } - /// @dev Returns whether metadata can be set in the given execution context. function _canSetMetadata() internal view virtual override returns (bool) { return hasRole(METADATA_ROLE, _msgSender()); diff --git a/contracts/prebuilts/token/TokenERC721.sol b/contracts/prebuilts/token/TokenERC721.sol index efb4ec23b..22c00caf5 100644 --- a/contracts/prebuilts/token/TokenERC721.sol +++ b/contracts/prebuilts/token/TokenERC721.sol @@ -47,9 +47,6 @@ import "../../lib/FeeType.sol"; // Helper interfaces import "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol"; -// OpenSea operator filter -import "../../extension/DefaultOperatorFiltererUpgradeable.sol"; - contract TokenERC721 is Initializable, IThirdwebContract, @@ -62,7 +59,6 @@ contract TokenERC721 is ERC2771ContextUpgradeable, MulticallUpgradeable, AccessControlEnumerableUpgradeable, - DefaultOperatorFiltererUpgradeable, ERC721EnumerableUpgradeable, ITokenERC721, NFTMetadata @@ -138,10 +134,8 @@ contract TokenERC721 is __EIP712_init("TokenERC721", "1"); __ERC2771Context_init(_trustedForwarders); __ERC721_init(_name, _symbol); - __DefaultOperatorFilterer_init(); // Initialize this contract's state. - _setOperatorRestriction(true); royaltyRecipient = _royaltyRecipient; royaltyBps = _royaltyBps; platformFeeRecipient = _platformFeeRecipient; @@ -420,57 +414,6 @@ contract TokenERC721 is } } - /// @dev See {ERC721-setApprovalForAll}. - function setApprovalForAll(address operator, bool approved) - public - override(ERC721Upgradeable, IERC721Upgradeable) - onlyAllowedOperatorApproval(operator) - { - super.setApprovalForAll(operator, approved); - } - - /// @dev See {ERC721-approve}. - function approve(address operator, uint256 tokenId) - public - override(ERC721Upgradeable, IERC721Upgradeable) - onlyAllowedOperatorApproval(operator) - { - super.approve(operator, tokenId); - } - - /// @dev See {ERC721-_transferFrom}. - function transferFrom( - address from, - address to, - uint256 tokenId - ) public override(ERC721Upgradeable, IERC721Upgradeable) onlyAllowedOperator(from) { - super.transferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public override(ERC721Upgradeable, IERC721Upgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public override(ERC721Upgradeable, IERC721Upgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId, data); - } - - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); - } - /// @dev Returns whether metadata can be set in the given execution context. function _canSetMetadata() internal view virtual override returns (bool) { return hasRole(METADATA_ROLE, _msgSender()); diff --git a/contracts/prebuilts/unaudited/burn-to-claim-drop/BurnToClaimDropERC721.sol b/contracts/prebuilts/unaudited/burn-to-claim-drop/BurnToClaimDropERC721.sol index e2dc63bc2..bc1072551 100644 --- a/contracts/prebuilts/unaudited/burn-to-claim-drop/BurnToClaimDropERC721.sol +++ b/contracts/prebuilts/unaudited/burn-to-claim-drop/BurnToClaimDropERC721.sol @@ -27,7 +27,6 @@ import "../../../extension/upgradeable/init/PrimarySaleInit.sol"; import "../../../extension/upgradeable/init/OwnableInit.sol"; import "../../../extension/upgradeable/init/ERC721AInit.sol"; import "../../../extension/upgradeable/init/PermissionsEnumerableInit.sol"; -import "../../../extension/upgradeable/init/DefaultOperatorFiltererInit.sol"; import "../../../extension/upgradeable/init/ReentrancyGuardInit.sol"; contract BurnToClaimDropERC721 is @@ -35,7 +34,6 @@ contract BurnToClaimDropERC721 is Multicall, ERC2771ContextUpgradeable, BaseRouter, - DefaultOperatorFiltererInit, ContractMetadataInit, PlatformFeeInit, RoyaltyInit, @@ -80,8 +78,6 @@ contract BurnToClaimDropERC721 is _setupPlatformFeeInfo(_platformFeeRecipient, _platformFeeBps); _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps); _setupPrimarySaleRecipient(_saleRecipient); - - _setupOperatorFilterer(); } function _setupRoles(address _defaultAdmin) internal onlyInitializing { diff --git a/contracts/prebuilts/unaudited/burn-to-claim-drop/extension/BurnToClaimDrop721Logic.sol b/contracts/prebuilts/unaudited/burn-to-claim-drop/extension/BurnToClaimDrop721Logic.sol index af5ea9799..3fc7ebed6 100644 --- a/contracts/prebuilts/unaudited/burn-to-claim-drop/extension/BurnToClaimDrop721Logic.sol +++ b/contracts/prebuilts/unaudited/burn-to-claim-drop/extension/BurnToClaimDrop721Logic.sol @@ -31,7 +31,6 @@ import { LazyMint } from "../../../../extension/upgradeable/LazyMint.sol"; import { Drop } from "../../../../extension/upgradeable/Drop.sol"; import { ContractMetadata } from "../../../../extension/upgradeable/ContractMetadata.sol"; import { Ownable } from "../../../../extension/upgradeable/Ownable.sol"; -import { DefaultOperatorFiltererUpgradeable } from "../../../../extension/upgradeable/DefaultOperatorFiltererUpgradeable.sol"; import { PermissionsStorage } from "../../../../extension/upgradeable/Permissions.sol"; import { BurnToClaim, BurnToClaimStorage } from "../../../../extension/upgradeable/BurnToClaim.sol"; @@ -46,7 +45,6 @@ contract BurnToClaimDrop721Logic is LazyMint, Drop, ERC2771ContextUpgradeable, - DefaultOperatorFiltererUpgradeable, ERC721AUpgradeable { using TWStrings for uint256; @@ -288,11 +286,6 @@ contract BurnToClaimDrop721Logic is return _hasRole(MINTER_ROLE, _msgSender()); } - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return _hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); - } - /// @dev Returns whether burn-to-claim info can be set in the given execution context. function _canSetBurnToClaim() internal view virtual override returns (bool) { return _hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); @@ -352,44 +345,6 @@ contract BurnToClaimDrop721Logic is } } - /// @dev See {ERC721-setApprovalForAll}. - function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { - super.setApprovalForAll(operator, approved); - } - - /// @dev See {ERC721-approve}. - function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) { - super.approve(operator, tokenId); - } - - /// @dev See {ERC721-_transferFrom}. - function transferFrom( - address from, - address to, - uint256 tokenId - ) public override(ERC721AUpgradeable) onlyAllowedOperator(from) { - super.transferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public override(ERC721AUpgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public override(ERC721AUpgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId, data); - } - function _hasRole(bytes32 role, address addr) internal view returns (bool) { PermissionsStorage.Data storage data = PermissionsStorage.data(); return data._hasRole[role][addr]; diff --git a/contracts/prebuilts/unaudited/evolving-nfts/EvolvingNFT.sol b/contracts/prebuilts/unaudited/evolving-nfts/EvolvingNFT.sol index f1623d036..42faab83d 100644 --- a/contracts/prebuilts/unaudited/evolving-nfts/EvolvingNFT.sol +++ b/contracts/prebuilts/unaudited/evolving-nfts/EvolvingNFT.sol @@ -23,7 +23,6 @@ import "../../../extension/upgradeable/init/OwnableInit.sol"; import "../../../extension/upgradeable/init/PermissionsEnumerableInit.sol"; import "../../../extension/upgradeable/init/ERC2771ContextInit.sol"; import "../../../extension/upgradeable/init/ERC721AQueryableInit.sol"; -import "../../../extension/upgradeable/init/DefaultOperatorFiltererInit.sol"; contract EvolvingNFT is Initializable, @@ -35,8 +34,7 @@ contract EvolvingNFT is RoyaltyInit, PrimarySaleInit, OwnableInit, - PermissionsEnumerableInit, - DefaultOperatorFiltererInit + PermissionsEnumerableInit { /// @dev Only EXTENSION_ROLE holders can update the contract's extensions. bytes32 private constant EXTENSION_ROLE = keccak256("EXTENSION_ROLE"); @@ -67,7 +65,6 @@ contract EvolvingNFT is _setupContractURI(_contractURI); _setupOwner(_defaultAdmin); - _setupOperatorFilterer(); _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin); _setupRole(EXTENSION_ROLE, _defaultAdmin); diff --git a/contracts/prebuilts/unaudited/evolving-nfts/EvolvingNFTLogic.sol b/contracts/prebuilts/unaudited/evolving-nfts/EvolvingNFTLogic.sol index 0b5493584..554bf09ce 100644 --- a/contracts/prebuilts/unaudited/evolving-nfts/EvolvingNFTLogic.sol +++ b/contracts/prebuilts/unaudited/evolving-nfts/EvolvingNFTLogic.sol @@ -36,9 +36,6 @@ import "../../../extension/upgradeable/Drop.sol"; import "../../../extension/upgradeable/SharedMetadataBatch.sol"; import { RulesEngine } from "../../../extension/upgradeable/RulesEngine.sol"; -// OpenSea operator filter -import "../../../extension/DefaultOperatorFiltererUpgradeable.sol"; - contract EvolvingNFTLogic is ContractMetadata, Royalty, @@ -47,7 +44,6 @@ contract EvolvingNFTLogic is SharedMetadataBatch, Drop, ERC2771ContextUpgradeable, - DefaultOperatorFiltererUpgradeable, ERC721AQueryableUpgradeable { using StringsUpgradeable for uint256; @@ -198,11 +194,6 @@ contract EvolvingNFTLogic is return _hasRole(MINTER_ROLE, _msgSender()); } - /// @dev Returns whether operator restriction can be set in the given execution context. - function _canSetOperatorRestriction() internal virtual override returns (bool) { - return _hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); - } - /// @dev Checks whether an account has a particular role. function _hasRole(bytes32 _role, address _account) internal view returns (bool) { PermissionsStorage.Data storage data = PermissionsStorage.data(); @@ -255,53 +246,6 @@ contract EvolvingNFTLogic is } } - /// @dev See {ERC721-setApprovalForAll}. - function setApprovalForAll(address operator, bool approved) - public - override(ERC721AUpgradeable, IERC721AUpgradeable) - onlyAllowedOperatorApproval(operator) - { - super.setApprovalForAll(operator, approved); - } - - /// @dev See {ERC721-approve}. - function approve(address operator, uint256 tokenId) - public - payable - override(ERC721AUpgradeable, IERC721AUpgradeable) - onlyAllowedOperatorApproval(operator) - { - super.approve(operator, tokenId); - } - - /// @dev See {ERC721-_transferFrom}. - function transferFrom( - address from, - address to, - uint256 tokenId - ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { - super.transferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId); - } - - /// @dev See {ERC721-_safeTransferFrom}. - function safeTransferFrom( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { - super.safeTransferFrom(from, to, tokenId, data); - } - function _dropMsgSender() internal view virtual override returns (address) { return _msgSender(); } diff --git a/src/test/EvolvingNFT.t.sol b/src/test/EvolvingNFT.t.sol index e90c3adde..53b6367f4 100644 --- a/src/test/EvolvingNFT.t.sol +++ b/src/test/EvolvingNFT.t.sol @@ -109,7 +109,7 @@ contract EvolvingNFTTest is BaseTest { "tokenURI(uint256)" ); evolvingNftExtension.functions[4] = IExtension.ExtensionFunction( - EvolvingNFTLogic.transferFrom.selector, + IERC721Upgradeable.transferFrom.selector, "transferFrom(address,address,uint256)" ); evolvingNftExtension.functions[5] = IExtension.ExtensionFunction(IERC721.ownerOf.selector, "ownerOf(uint256)"); diff --git a/src/test/burn-to-claim-drop/BurnToClaimDropERC721.t.sol b/src/test/burn-to-claim-drop/BurnToClaimDropERC721.t.sol index 35939248e..eb7466e35 100644 --- a/src/test/burn-to-claim-drop/BurnToClaimDropERC721.t.sol +++ b/src/test/burn-to-claim-drop/BurnToClaimDropERC721.t.sol @@ -163,15 +163,15 @@ contract BurnToClaimDropERC721Test is BaseTest, IExtension { "nextTokenIdToMint()" ); extension_drop.functions[12] = ExtensionFunction( - BurnToClaimDrop721Logic.setApprovalForAll.selector, + IERC721Upgradeable.setApprovalForAll.selector, "setApprovalForAll(address,bool)" ); extension_drop.functions[13] = ExtensionFunction( - BurnToClaimDrop721Logic.approve.selector, + IERC721Upgradeable.approve.selector, "approve(address,uint256)" ); extension_drop.functions[14] = ExtensionFunction( - BurnToClaimDrop721Logic.transferFrom.selector, + IERC721Upgradeable.transferFrom.selector, "transferFrom(address,address,uint256)" ); extension_drop.functions[15] = ExtensionFunction(ERC721AUpgradeable.balanceOf.selector, "balanceOf(address)");