LimitedMintModule

Git Source

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

NameTypeDescription
characterIduint256The character ID of the note to initialize.
noteIduint256The note ID to initialize.
databytesThe data passed from the user to be decoded.

Returns

NameTypeDescription
<none>bytesbytes 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

NameTypeDescription
toaddressThe receive address of the NFT.
characterIduint256The character ID of the note owner.
noteIduint256The 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

NameTypeDescription
characterIduint256ID of the character to query.
noteIduint256ID of the note to query.
accountaddressThe address to query.

Returns

NameTypeDescription
maxSupplyuint256The max supply of nft that can be minted.
currentSupplyuint256The current supply of nft that has been minted.
maxMintPerAddressuint256The amount that each address can mint.
mintedAmountuint256The amount that the address has already minted.

Structs

LimitedMintInfo

struct LimitedMintInfo {
    uint256 maxSupply;
    uint256 currentSupply;
    uint256 maxMintPerAddress;
}