# ERC721CommunityBase [Git Source](https://github.com/buildship-dev/nft-contracts/blob/fd1c33a9dbefe42158dfc60d10c0afde05c713aa/contracts/ERC721CommunityBase.sol) **Inherits:** ERC721A, ReentrancyGuard, Ownable, [IERC721Community](/wiki/src/contracts/interfaces/IERC721Community.sol/contract.IERC721Community.md) *This contract is licensed under the MIT license.* *You're not allowed to remove DEVELOPER() and DEVELOPER_ADDRESS() from contract* ## State Variables ### SALE_STARTS_AT_INFINITY ```solidity uint256 internal constant SALE_STARTS_AT_INFINITY = 2 ** 256 - 1; ``` ### DEVELOPER_FEE ```solidity uint256 internal constant DEVELOPER_FEE = 500; ``` ### MAX_PER_MINT_LIMIT ```solidity uint256 internal constant MAX_PER_MINT_LIMIT = 50; ``` ### OPENSEA_CONDUIT ```solidity address internal constant OPENSEA_CONDUIT = 0x1E0049783F008A0085193E00003D00cd54003c71; ``` ### startTimestamp ```solidity uint256 public startTimestamp = SALE_STARTS_AT_INFINITY; ``` ### reserved ```solidity uint256 public reserved; ``` ### maxSupply ```solidity uint256 public maxSupply; ``` ### maxPerMint ```solidity uint256 public maxPerMint; ``` ### maxPerWallet ```solidity uint256 public maxPerWallet; ``` ### price ```solidity uint256 public price; ``` ### royaltyFee ```solidity uint256 public royaltyFee; ``` ### royaltyReceiver ```solidity address public royaltyReceiver; ``` ### payoutReceiver ```solidity address public payoutReceiver; ``` ### uriExtension ```solidity address public uriExtension; ``` ### isPayoutChangeLocked ```solidity bool public isPayoutChangeLocked; ``` ### isOpenSeaProxyActive ```solidity bool private isOpenSeaProxyActive; ``` ### startAtOne ```solidity bool private startAtOne; ``` ### data *Additional data for each token that needs to be stored and accessed on-chain* ```solidity mapping(uint256 => bytes32) public data; ``` ### mintedBy *Storing how many tokens each address has minted in public sale* ```solidity mapping(address => uint256) public mintedBy; ``` ### extensions *List of connected extensions* ```solidity INFTExtension[] public extensions; ``` ### PROVENANCE_HASH ```solidity string public PROVENANCE_HASH = ""; ``` ### CONTRACT_URI ```solidity string private CONTRACT_URI = ""; ``` ### BASE_URI ```solidity string private BASE_URI; ``` ### URI_POSTFIX ```solidity string private URI_POSTFIX = ""; ``` ## Functions ### constructor ```solidity constructor( string memory _name, string memory _symbol, uint256 _maxSupply, uint256 _nReserved, bool _startAtOne, string memory _uri, MintConfig memory _config ) ERC721A(_name, _symbol); ``` ### _configure ```solidity function _configure( uint256 publicPrice, uint256 maxTokensPerMint, uint256 maxTokensPerWallet, uint256 _royaltyFee, address _payoutReceiver, bool shouldLockPayoutReceiver, bool shouldStartSale, bool shouldUseJsonExtension ) internal; ``` ### _baseURI ```solidity function _baseURI() internal view override returns (string memory); ``` ### _startTokenId ```solidity function _startTokenId() internal view virtual override returns (uint256); ``` ### contractURI ```solidity function contractURI() public view returns (string memory uri); ``` ### tokenURI ```solidity function tokenURI(uint256 tokenId) public view override returns (string memory); ``` ### startTokenId ```solidity function startTokenId() public view returns (uint256); ``` ### setBaseURI ```solidity function setBaseURI(string calldata uri) public onlyOwner; ``` ### setContractURI ```solidity function setContractURI(string calldata uri) public onlyOwner; ``` ### setPostfixURI ```solidity function setPostfixURI(string memory postfix) public onlyOwner; ``` ### setPrice ```solidity function setPrice(uint256 _price) public onlyOwner; ``` ### reduceMaxSupply ```solidity function reduceMaxSupply(uint256 _maxSupply) public whenSaleNotStarted onlyOwner; ``` ### lockPayoutReceiver ```solidity function lockPayoutReceiver() public onlyOwner; ``` ### isExtensionAdded ```solidity function isExtensionAdded(address _extension) public view returns (bool); ``` ### extensionsLength ```solidity function extensionsLength() public view returns (uint256); ``` ### addExtension ```solidity function addExtension(address _extension) public onlyOwner; ``` ### revokeExtension ```solidity function revokeExtension(address _extension) public onlyOwner; ``` ### setExtensionTokenURI ```solidity function setExtensionTokenURI(address extension) public onlyOwner; ``` ### setIsOpenSeaProxyActive ```solidity function setIsOpenSeaProxyActive(bool _isOpenSeaProxyActive) public onlyOwner; ``` ### _mintConsecutive ```solidity function _mintConsecutive(uint256 nTokens, address to, bytes32 extraData) internal; ``` ### whenSaleStarted ```solidity modifier whenSaleStarted(); ``` ### whenSaleNotStarted ```solidity modifier whenSaleNotStarted(); ``` ### whenNotPayoutChangeLocked ```solidity modifier whenNotPayoutChangeLocked(); ``` ### onlyExtension ```solidity modifier onlyExtension(); ``` ### mint ```solidity function mint(uint256 nTokens) external payable nonReentrant whenSaleStarted; ``` ### claim ```solidity function claim(uint256 nTokens, address to) external nonReentrant onlyOwner; ``` ### mintExternal ```solidity function mintExternal(uint256 nTokens, address to, bytes32 extraData) external payable onlyExtension nonReentrant; ``` ### updateMaxPerMint ```solidity function updateMaxPerMint(uint256 _maxPerMint) public onlyOwner nonReentrant; ``` ### updateMaxPerWallet ```solidity function updateMaxPerWallet(uint256 _maxPerWallet) public onlyOwner nonReentrant; ``` ### updateStartTimestamp ```solidity function updateStartTimestamp(uint256 _startTimestamp) public onlyOwner; ``` ### startSale ```solidity function startSale() public onlyOwner; ``` ### stopSale ```solidity function stopSale() public onlyOwner; ``` ### saleStarted ```solidity function saleStarted() public view returns (bool); ``` ### setProvenanceHash ```solidity function setProvenanceHash(string memory provenanceHash) public onlyOwner; ``` ### setRoyaltyFee ```solidity function setRoyaltyFee(uint256 _royaltyFee) public onlyOwner; ``` ### setRoyaltyReceiver ```solidity function setRoyaltyReceiver(address _receiver) public onlyOwner; ``` ### setPayoutReceiver ```solidity function setPayoutReceiver(address _receiver) public onlyOwner whenNotPayoutChangeLocked; ``` ### royaltyInfo ```solidity function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); ``` ### getPayoutReceiver ```solidity function getPayoutReceiver() public view returns (address payable receiver); ``` ### getRoyaltyReceiver ```solidity function getRoyaltyReceiver() public view returns (address payable receiver); ``` ### receive ```solidity receive() external payable; ``` ### onlyDeveloper ```solidity modifier onlyDeveloper(); ``` ### _withdraw ```solidity function _withdraw() private; ``` ### withdraw ```solidity function withdraw() public virtual onlyOwner; ``` ### forceWithdrawDeveloper ```solidity function forceWithdrawDeveloper() public virtual onlyDeveloper; ``` ### withdrawToken ```solidity function withdrawToken(IERC20 token) public virtual onlyOwner; ``` ### DEVELOPER ```solidity function DEVELOPER() public pure returns (string memory _url); ``` ### DEVELOPER_ADDRESS ```solidity function DEVELOPER_ADDRESS() public pure returns (address payable _dev); ``` ### supportsInterface ```solidity function supportsInterface(bytes4 interfaceId) public view override returns (bool); ``` ### isApprovedForAll *Override isApprovedForAll to allowlist user's OpenSea proxy accounts to enable gas-less listings. Taken from CryptoCoven: https://etherscan.io/address/0x5180db8f5c931aae63c74266b211f580155ecac8#code* ```solidity function isApprovedForAll(address owner, address operator) public view override returns (bool); ``` ## Events ### ExtensionAdded ```solidity event ExtensionAdded(address indexed extensionAddress); ``` ### ExtensionRevoked ```solidity event ExtensionRevoked(address indexed extensionAddress); ``` ### ExtensionURIAdded ```solidity event ExtensionURIAdded(address indexed extensionAddress); ```