Skip to main content

Token Manager Smart Contract (1.0.0)

Download OpenAPI specification:Download

The Token Manager is a smart contract designed to manage the creation, minting, burning, and transfer of Klever Digital Assets (KDAs). It provides a comprehensive set of functions to handle token lifecycle management.

Overview

The Token Manager contract enables:

  • Token Creation: Create new fungible or semi-fungible tokens (SFTs)
  • Minting: Mint additional tokens to the contract or specific addresses
  • Burning: Burn tokens to reduce supply
  • Transfers: Transfer tokens between addresses

Endpoints

Write operations that modify contract state

Create Token

Creates a new Klever Digital Asset (KDA) token with specified properties.

Process:

  1. Validates the token parameters
  2. Creates the token on the Klever blockchain
  3. Returns the new token identifier

Token Properties:

  • Name and ticker symbol
  • Precision (decimal places)
  • Initial supply
  • Token type (Fungible or SFT)
  • Owner address and roles

Note: The contract address will be set as the owner of the created token, allowing it to manage minting and burning operations.

Request Body schema: application/json
required
scAddress
required
string

Token Manager contract address

funcName
required
string
Value: "createToken"
args
required
Array of strings

Arguments for token creation:

  • name (string): Token name
  • ticker (string): Token ticker symbol
  • precision (u32): Number of decimal places
  • initial_supply (BigUint): Initial token supply
  • token_type (u8): 0 for Fungible, 1 for SFT

Responses

Request samples

Content type
application/json
Example
{
  • "scAddress": "klv1qqqqqqqqqqqqqpgq9696g7x76kwrrh02fahn4rpem4v595t8c0nqgxzpmu",
  • "funcName": "createToken",
  • "args": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "error": "string",
  • "code": "string"
}

Mint Tokens

Mints new tokens to the contract address, increasing the total supply.

Process:

  1. Validates the caller has minting permissions
  2. Mints the specified amount of tokens
  3. Tokens are held by the contract

Requirements:

  • Caller must have mint role or be the contract owner
  • Token must exist and be mintable

Use Cases:

  • Minting LP tokens when liquidity is added
  • Creating reward tokens for distribution
  • Generating locked token representations
Request Body schema: application/json
required
scAddress
required
string

Token Manager contract address

funcName
required
string
Value: "mint"
args
required
Array of strings

Arguments:

  • token_id (TokenIdentifier): Token to mint
  • amount (BigUint): Amount to mint

Responses

Request samples

Content type
application/json
{
  • "scAddress": "klv1qqqqqqqqqqqqqpgq9696g7x76kwrrh02fahn4rpem4v595t8c0nqgxzpmu",
  • "funcName": "mint",
  • "args": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "error": "string",
  • "code": "string"
}

Mint Tokens to Address

Mints new tokens directly to a specified address.

Process:

  1. Validates the caller has minting permissions
  2. Mints the specified amount of tokens
  3. Transfers minted tokens directly to the destination address

Requirements:

  • Caller must have mint role or be the contract owner
  • Token must exist and be mintable
  • Destination address must be valid

Use Cases:

  • Direct reward distribution to users
  • Minting tokens for liquidity providers
  • Creating tokens for specific recipients
Request Body schema: application/json
required
scAddress
required
string

Token Manager contract address

funcName
required
string
Value: "mintWithAddress"
args
required
Array of strings

Arguments:

  • token_id (TokenIdentifier): Token to mint
  • amount (BigUint): Amount to mint
  • destination (ManagedAddress): Address to receive tokens

Responses

Request samples

Content type
application/json
{
  • "scAddress": "klv1qqqqqqqqqqqqqpgq9696g7x76kwrrh02fahn4rpem4v595t8c0nqgxzpmu",
  • "funcName": "mintWithAddress",
  • "args": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "error": "string",
  • "code": "string"
}

Burn Tokens

Burns tokens, permanently removing them from circulation and reducing total supply.

Process:

  1. Validates the caller has burn permissions
  2. Verifies sufficient token balance
  3. Burns the specified amount of tokens

Requirements:

  • Caller must have burn role or be the contract owner
  • Contract must hold sufficient tokens to burn
  • Token must exist and be burnable

Use Cases:

  • Burning LP tokens when liquidity is removed
  • Deflationary token mechanisms
  • Removing locked token representations after unlock
Request Body schema: application/json
required
scAddress
required
string

Token Manager contract address

funcName
required
string
Value: "burn"
args
required
Array of strings

Arguments:

  • token_id (TokenIdentifier): Token to burn
  • amount (BigUint): Amount to burn

Responses

Request samples

Content type
application/json
{
  • "scAddress": "klv1qqqqqqqqqqqqqpgq9696g7x76kwrrh02fahn4rpem4v595t8c0nqgxzpmu",
  • "funcName": "burn",
  • "args": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "error": "string",
  • "code": "string"
}

Transfer Tokens

Transfers tokens from the contract to a specified address.

Process:

  1. Validates the caller has transfer permissions
  2. Verifies sufficient token balance in contract
  3. Transfers tokens to the destination address

Requirements:

  • Caller must have transfer permissions or be the contract owner
  • Contract must hold sufficient tokens
  • Destination address must be valid

Use Cases:

  • Distributing tokens to users
  • Sending rewards
  • Moving tokens between protocol contracts
Request Body schema: application/json
required
scAddress
required
string

Token Manager contract address

funcName
required
string
Value: "transfer"
args
required
Array of strings

Arguments:

  • token_id (TokenIdentifier): Token to transfer
  • amount (BigUint): Amount to transfer
  • destination (ManagedAddress): Address to receive tokens

Responses

Request samples

Content type
application/json
{
  • "scAddress": "klv1qqqqqqqqqqqqqpgq9696g7x76kwrrh02fahn4rpem4v595t8c0nqgxzpmu",
  • "funcName": "transfer",
  • "args": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "error": "string",
  • "code": "string"
}