Skip to content

Commit

Permalink
Connect BurnExtension in ERC721CommunityBase.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
AutoPR committed Apr 30, 2023
1 parent ac4e4cc commit bccf495
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions contracts/ERC721CommunityBase.sol
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit bccf495

Please sign in to comment.