The DraftMultiMinter is a robust ERC-1155 contract facilitating the creation of various token types that are essential for diverse game mechanics and economies. This contract is specifically designed to enable:
- Fungible Tokens (FTs): Represent in-game resources like currency and experience boosters.
- Non-Fungible Tokens (NFTs): Serve as unique player cards, stadium elements, or collectible game assets.
- Distinct Token Types: Effortlessly categorize tokens into their specific roles, simplifying the creation of multifaceted game mechanics.
- Efficient Minting: Mints both fungible and non-fungible tokens in a streamlined manner.
- NFT Supply Management: Tracks the supply of NFTs with built-in safeguards to prevent over-minting and maintain scarcity.
- Metadata Handling: Provides a standard mechanism for defining individual token metadata that's compatible with external marketplaces and visualization tools.
- Ownable: Includes ownership controls to regulate contract administration.
- Pausable: Offers the ability to pause token transfers as needed for updates or emergency scenarios.
-
ERC-1155 Standard: Leverages the ERC-1155 standard to establish core functionalities for minting multiple token types with associated amounts and metadata in a single contract.
-
Token Type Enumeration: The
TokenTypeenum allows for clear identification of supported token categories:IN_GAME_CURRENCYEXPERIENCE_BOOSTPLAYER_CARDSTADIUM_VILLAGE_BUILDING
-
Minting Functions: The contract implements separate functions for efficient minting:
mintFT(): Mint fungible tokens with defined types and quantities.mintNFT(): Create NFTs, tracking supply to enforce limits.
-
Metadata Management:
setURI(): Provides an administrative function to update the base URI for metadata.uri(): Overrides the standarduri()function to fetch dynamic metadata for each token based on its ID and the base URI.
-
Deployment:
- Deploy the
DraftMultiMinter.solcontract to your desired blockchain environment.
- Deploy the
-
Configuration:
- Replace the placeholder in the constructor (
"https://turquoise-rear-loon-357.mypinata.cloud/ipfs/QmahUaDqT8b4dMcibzZJzVy2edV2rTU6sKDUqcNavJEMJ7/{id}.json") with your actual base metadata URI if the IPFS-stored structure differs.
- Replace the placeholder in the constructor (
-
Minting:
- Use the
mintFT()andmintNFT()functions to create the necessary tokens for your game.
- Use the
To ensure efficient usage, make note of the following:
getTokenId()Function: Utilize this function to obtain the token ID associated with a particularTokenTypewhich is vital for minting calls.isFungibleToken()andisNonFungibleToken(): Employ these helper functions to easily determine the type of a given token ID.- Access Controls: Be cognizant that sensitive calls, such as minting, are reserved for the contract owner.