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

ERC-20 tokens

For complete fixed-supply examples in all seven languages, use Basic token in every language. The PQToken example below is the separate owner-mintable Foundry tutorial.

Fungible tokens follow ERC-20 unchanged. Tested end to end in Create a token.

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

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

/// Example ERC-20 with an owner-only mint. Unaudited tutorial code.
contract PQToken is ERC20, Ownable {
    constructor(string memory name_, string memory symbol_, uint256 initialSupply, address owner_)
        ERC20(name_, symbol_)
        Ownable(owner_)
    {
        _mint(owner_, initialSupply);
    }

    function mint(address to, uint256 amount) external onlyOwner {
        _mint(to, amount);
    }
}
Function / event Notes
balanceOf, totalSupply, decimals decimals() is display-only; on-chain amounts are integers
transfer, transferFrom Emit Transfer(from, to, value)
approve, allowance Emit Approval; prefer exact amounts — the Windows Wallet warns on unlimited approvals
Mint / burn Transfer from / to the zero address

Support on PQWERAI

  • Windows Wallet: discovers balances, transfers, and warns about native-tPQAI impostors and hidden characters.
  • Explorer: indexes ERC-20 Transfer events (/api/v1/tokens, /api/v1/address/{address}).
  • Native tPQAI is not an ERC-20. The WETH9-style wrapper is tWPQAI; see standard contracts.
  • Permit (EIP-2612) works (it only needs ecrecover and the chain ID); a Studio wizard is unreleased.

Sources at 83ff5b69f0 (project repository, not public yet): developers/examples/token/src/PQToken.sol · developers/examples/token/deploy-token.sh

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