Skip to content

contract.ERC721CommunityImplementation_

Aleksey Bykhun edited this page Jan 18, 2023 · 1 revision

ERC721CommunityImplementation_

Git Source

Inherits: ERC721AUpgradeable, ReentrancyGuardUpgradeable, OwnableUpgradeable, DefaultOperatorFiltererUpgradeable, IERC721CommunityImplementation, IERC721Community

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

uint256 internal constant SALE_STARTS_AT_INFINITY = 2 ** 256 - 1;

DEVELOPER_FEE

uint256 internal constant DEVELOPER_FEE = 500;

MAX_PER_MINT_LIMIT

uint256 internal constant MAX_PER_MINT_LIMIT = 50;

OPENSEA_CONDUIT

address internal constant OPENSEA_CONDUIT = 0x1E0049783F008A0085193E00003D00cd54003c71;

VERSION

uint256 public constant VERSION = 2;

startTimestamp

uint256 public startTimestamp = SALE_STARTS_AT_INFINITY;

reserved

uint256 public reserved;

maxSupply

uint256 public maxSupply;

maxPerMint

uint256 public maxPerMint;

maxPerWallet

uint256 public maxPerWallet;

price

uint256 public price;

royaltyFee

uint256 public royaltyFee;

royaltyReceiver

address public royaltyReceiver;

payoutReceiver

address public payoutReceiver;

uriExtension

address public uriExtension;

isPayoutChangeLocked

bool public isPayoutChangeLocked;

isOpenSeaProxyActive

bool private isOpenSeaProxyActive;

startAtOne

bool private startAtOne;

data

Additional data for each token that needs to be stored and accessed on-chain

mapping(uint256 => bytes32) public data;

mintedBy

Storing how many tokens each address has minted in public sale

mapping(address => uint256) public mintedBy;

extensions

List of connected extensions

INFTExtension[] public extensions;

PROVENANCE_HASH

string public PROVENANCE_HASH = "";

CONTRACT_URI

string private CONTRACT_URI = "";

BASE_URI

string private BASE_URI;

URI_POSTFIX

string private URI_POSTFIX = "";

Functions

initialize

function initialize(
    string memory _name,
    string memory _symbol,
    uint256 _maxSupply,
    uint256 _nReserved,
    bool _startAtOne,
    string memory _uri,
    MintConfig memory _config
) public initializerERC721A initializer;

_configure

function _configure(
    uint256 publicPrice,
    uint256 maxTokensPerMint,
    uint256 maxTokensPerWallet,
    uint256 _royaltyFee,
    address _payoutReceiver,
    bool shouldLockPayoutReceiver,
    bool shouldStartSale,
    bool shouldUseJsonExtension
) internal;

constructor

constructor() initializer;

_baseURI

function _baseURI() internal view override returns (string memory);

_startTokenId

function _startTokenId() internal view virtual override returns (uint256);

contractURI

function contractURI() public view returns (string memory uri);

tokenURI

function tokenURI(uint256 tokenId) public view override returns (string memory);

startTokenId

function startTokenId() public view returns (uint256);

toggleOpenSeaTransferFilter

function toggleOpenSeaTransferFilter() public onlyOwner;

setBaseURI

function setBaseURI(string calldata uri) public onlyOwner;

setContractURI

function setContractURI(string calldata uri) public onlyOwner;

setPostfixURI

function setPostfixURI(string memory postfix) public onlyOwner;

setPrice

function setPrice(uint256 _price) public onlyOwner;

reduceMaxSupply

function reduceMaxSupply(uint256 _maxSupply) public whenSaleNotStarted onlyOwner;

lockPayoutReceiver

function lockPayoutReceiver() public onlyOwner;

isExtensionAdded

function isExtensionAdded(address _extension) public view returns (bool);

extensionsLength

function extensionsLength() public view returns (uint256);

addExtension

function addExtension(address _extension) public onlyOwner;

revokeExtension

function revokeExtension(address _extension) public onlyOwner;

setExtensionTokenURI

function setExtensionTokenURI(address extension) public onlyOwner;

setIsOpenSeaProxyActive

function setIsOpenSeaProxyActive(bool _isOpenSeaProxyActive) public onlyOwner;

_mintConsecutive

function _mintConsecutive(uint256 nTokens, address to, bytes32 extraData) internal;

whenSaleStarted

modifier whenSaleStarted();

whenSaleNotStarted

modifier whenSaleNotStarted();

whenNotPayoutChangeLocked

modifier whenNotPayoutChangeLocked();

onlyExtension

modifier onlyExtension();

mint

function mint(uint256 nTokens) external payable nonReentrant whenSaleStarted;

claim

function claim(uint256 nTokens, address to) external nonReentrant onlyOwner;

mintExternal

function mintExternal(uint256 nTokens, address to, bytes32 extraData) external payable onlyExtension nonReentrant;

updateMaxPerMint

function updateMaxPerMint(uint256 _maxPerMint) public onlyOwner nonReentrant;

updateMaxPerWallet

function updateMaxPerWallet(uint256 _maxPerWallet) public onlyOwner nonReentrant;

updateStartTimestamp

function updateStartTimestamp(uint256 _startTimestamp) public onlyOwner;

startSale

function startSale() public onlyOwner;

stopSale

function stopSale() public onlyOwner;

saleStarted

function saleStarted() public view returns (bool);

setProvenanceHash

function setProvenanceHash(string memory provenanceHash) public onlyOwner;

setRoyaltyFee

function setRoyaltyFee(uint256 _royaltyFee) public onlyOwner;

setRoyaltyReceiver

function setRoyaltyReceiver(address _receiver) public onlyOwner;

setPayoutReceiver

function setPayoutReceiver(address _receiver) public onlyOwner whenNotPayoutChangeLocked;

royaltyInfo

function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount);

getPayoutReceiver

function getPayoutReceiver() public view returns (address payable receiver);

getRoyaltyReceiver

function getRoyaltyReceiver() public view returns (address payable receiver);

receive

receive() external payable;

onlyDeveloper

modifier onlyDeveloper();

_withdraw

function _withdraw() private;

withdraw

function withdraw() public virtual onlyOwner;

forceWithdrawDeveloper

function forceWithdrawDeveloper() public virtual onlyDeveloper;

withdrawToken

function withdrawToken(IERC20 token) public virtual onlyOwner;

DEVELOPER

function DEVELOPER() internal pure returns (string memory _url);

DEVELOPER_ADDRESS

function DEVELOPER_ADDRESS() internal pure returns (address payable _dev);

_beforeTokenTransfers

function _beforeTokenTransfers(address from, address to, uint256 startId, uint256 quantity)
    internal
    override
    onlyAllowedOperator(from);

supportsInterface

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

function isApprovedForAll(address owner, address operator) public view override returns (bool);

Events

ExtensionAdded

event ExtensionAdded(address indexed extensionAddress);

ExtensionRevoked

event ExtensionRevoked(address indexed extensionAddress);

ExtensionURIAdded

event ExtensionURIAdded(address indexed extensionAddress);
Clone this wiki locally