Skip to main content

ERC1155Mintable

import "@thirdweb-dev/contracts/extension/interface/IMintableERC721.sol";

ERC1155Mintable allows you to mint new NFTs into your ERC1155 NFT collection contract.

info

This extension is an interface and requires all of the functions to be implemented


Usage

This is an example smart contract demonstrating how to inherit from this extension and override the functions to add (optional) custom functionality.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@thirdweb-dev/contracts/eip/ERC1155.sol";
import "@thirdweb-dev/contracts/extension/interface/IMintableERC1155.sol";

contract Contract is ERC1155, IMintableERC1155 {
constructor(
string memory _name,
string memory _symbol
)
ERC1155(
_name,
_symbol
)
{}

function mintTo(
address to,
uint256 tokenId,
string calldata uri,
uint256 amount
) external override {
// Your custom implementation here
}
}

SDK Usage

By adding this extension to a smart contract, the following features, hooks and functions are unlocked in the SDK:

Base Contracts Implementing This Extension