Skip to content
Testnet featureTestnet: yesMainnet: Not availableSoftware: Core bad4a06ea · protocol pqwerai-v8-testnet/1Updated

ERC-1155 multi-tokens

ERC-1155 manages many token IDs (fungible or unique) in one contract. Deployment, minting and transfer are tested in Create NFTs.

PQItems.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

/// Example ERC-1155 multi-token: one contract, many fungible or non-fungible IDs. The URI uses the {id}
/// substitution defined by ERC-1155 (64 lower-case hex characters). Unaudited tutorial code.
contract PQItems is ERC1155, Ownable {
    constructor(string memory uri_, address owner_) ERC1155(uri_) Ownable(owner_) {}

    function mint(address to, uint256 id, uint256 amount) external onlyOwner {
        _mint(to, id, amount, "");
    }
}
  • uri(id) returns a template; clients replace {id} with the 64-character lower-case hex ID.
  • safeBatchTransferFrom and balanceOfBatch move or read many IDs in one call.
  • Events: TransferSingle, TransferBatch, URI.

Tooling limits on PQWERAI today

The explorer does not decode ERC-1155 events yet. The wallet includes a Studio template; comprehensive Tokens-page balance display is a separate feature. Read balances with balanceOf(account, id) until support ships.


Sources at 83ff5b69f0 (project repository, not public yet): developers/examples/nft/src/PQItems.sol

Found a problem? Report a documentation issue · Build testnet-20778+83ff5b69f0