-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Connect BurnExtension in ERC721CommunityBase.sol
- Loading branch information
AutoPR
committed
Apr 30, 2023
1 parent
ac4e4cc
commit bccf495
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |