diff --git a/contracts/ERC721CommunityBase.sol b/contracts/ERC721CommunityBase.sol new file mode 100644 index 00000000..703ba2d6 --- /dev/null +++ b/contracts/ERC721CommunityBase.sol @@ -0,0 +1,39 @@ +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721EnumerableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721MetadataUpgradeable.sol"; +import "./extensions/ERC721CommunityMint.sol"; +import "./extensions/BurnExtension.sol"; + +contract ERC721CommunityBase is Initializable, ReentrancyGuardUpgradeable, IERC721ReceiverUpgradeable, ERC721CommunityMint, BurnExtension { + using AddressUpgradeable for address; + + function initialize( + string memory name, + string memory symbol, + uint256 maxCommunityTokens, + uint256 maxSupply, + address trustedForwarder, + address admin + ) public initializer { + __ERC721CommunityMint_init(name, symbol, maxCommunityTokens, maxSupply, trustedForwarder, admin); + __BurnExtension_init(maxSupply); + } + + function supportsInterface(bytes4 interfaceId) + public + view + override(ERC721Upgradeable, IERC721MetadataUpgradeable, IERC721EnumerableUpgradeable, ERC721CommunityMint, BurnExtension) + returns (bool) + { + return super.supportsInterface(interfaceId); + } + + function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external view override returns (bytes4) { + return this.onERC721Received.selector; + } +} \ No newline at end of file