The MyNFT contract is a non-fungible token (NFT) contract that extends the ERC721 contract from the OpenZeppelin library. It allows for the minting and management of unique, collectible tokens.
- mintingRate: The maximum number of tokens that can be minted in a single block.
- lastMintedBlock: The block number of the last time a token was minted.
- mintsInCurrentBlock: The number of tokens minted in the current block.
- nftPrice: The price of each token in wei.
- members: A mapping of addresses to booleans representing whether or not they are members of the DAO.
Mints a new token and assigns it to the specified address.
- _to: The address to assign the token to.
- _tokenId: The unique ID of the token to mint.
Mints a new token and assigns it to the caller, provided that they have sent the required payment to the contract. Also enforces the minting rate and block restrictions.
- _tokenId: The unique ID of the token to mint.
- payable: The function accepts ether payments.
Adds the specified address to the list of members of the DAO.
- _member: The address to add as a member.
Updates the minting rate of the contract. Can only be called by members of the DAO, and requires a majority vote of the members in favor of the change.
- _newRate: The new minting rate to set.
- onlyMembers: The function can only be called by members of the DAO.