The bibi::nft_mint
module defines a smart contract on the Aptos Blockchain for minting NFTs within the exclusive Bibi collection. This contract allows users to mint unique NFTs, each associated with a specific identifier and metadata.
- Aptos Blockchain environment
- Move language compiler and runtime
- Deploy the smart contract on the Aptos Blockchain.
- Ensure that the
aptos_token
and other required modules are available.
The smart contract must be initialized by an administrator. This sets up the minting pool and creates the NFT collection.
// Example initialization
admin_address = @bibi;
bibi::nft_mint::init(&admin_address);
Users can mint NFTs by invoking the mint
function, providing the user's signer address and the desired count of NFTs.
// Example minting
user_signer = <user_signer_address>;
count_to_mint = 3;
bibi::nft_mint::mint(&user_signer, count_to_mint);
MODULE_BIBI
: Address of the Bibi NFT Mint module.NAME
: Name of the NFT collection.DESCRIPTION
: Description of the NFT collection.COUNT
: Total number of NFTs in the collection.BASE_URL
: Base URL for generating NFT metadata URLs.COLLECTION_URL
: URL to the external collection description.
NO_ADMIN
: Error code indicating that the initialization was not invoked by the correct administrator.ALREADY_MINTED
: Error code indicating an attempt to mint an NFT that has already been minted.EXCEED_MINT_COUNT
: Error code indicating an attempt to mint more NFTs than the allowed limit.
MintInfo
: Structure holding information about the minting pool, minted NFTs, and the current identifier.
init(admin: &signer)
: Initializes the smart contract with an administrator account.mint(user: &signer, count: u64)
: Allows users to mint a specified number of NFTs.
num_to_str(num: u64)
: Converts a number to a vector of bytes.