LimitedMintModule
Inherits: IMintModule4Note, ModuleBase
This is a simple MintModule implementation, inheriting from the IMintModule4Note interface. This module works by allowing limited minting for a post.
State Variables
_limitedMintInfo
mapping(uint256 => mapping(uint256 => LimitedMintInfo)) internal _limitedMintInfo;
_mintedAmount
mapping(uint256 => mapping(uint256 => mapping(address => uint256))) internal _mintedAmount;
Functions
constructor
constructor(address web3Entry_) ModuleBase(web3Entry_);
initializeMintModule
Initialize the MintModule for a specific note.
The data should an abi encoded bytes of (uint256,uint256)
function initializeMintModule(uint256 characterId, uint256 noteId, bytes calldata data)
external
override
onlyWeb3Entry
returns (bytes memory);
Parameters
Name | Type | Description |
---|---|---|
characterId | uint256 | The character ID of the note to initialize. |
noteId | uint256 | The note ID to initialize. |
data | bytes | The data passed from the user to be decoded. |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | bytes The returned data of calling initializeMintModule. |
processMint
Process minting and check if the caller is eligible.
function processMint(address to, uint256 characterId, uint256 noteId, bytes calldata) external override onlyWeb3Entry;
Parameters
Name | Type | Description |
---|---|---|
to | address | The receive address of the NFT. |
characterId | uint256 | The character ID of the note owner. |
noteId | uint256 | The note ID. |
<none> | bytes |
getLimitedMintInfo
Returns the info indicates the limited mint info of an address.
function getLimitedMintInfo(uint256 characterId, uint256 noteId, address account)
external
view
returns (uint256 maxSupply, uint256 currentSupply, uint256 maxMintPerAddress, uint256 mintedAmount);
Parameters
Name | Type | Description |
---|---|---|
characterId | uint256 | ID of the character to query. |
noteId | uint256 | ID of the note to query. |
account | address | The address to query. |
Returns
Name | Type | Description |
---|---|---|
maxSupply | uint256 | The max supply of nft that can be minted. |
currentSupply | uint256 | The current supply of nft that has been minted. |
maxMintPerAddress | uint256 | The amount that each address can mint. |
mintedAmount | uint256 | The amount that the address has already minted. |
Structs
LimitedMintInfo
struct LimitedMintInfo {
uint256 maxSupply;
uint256 currentSupply;
uint256 maxMintPerAddress;
}