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.
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
Create Token
Creates a new Klever Digital Asset (KDA) token with specified properties.
Process:
- Validates the token parameters
- Creates the token on the Klever blockchain
- 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/jsonrequired
| scAddress required | string Token Manager contract address |
| funcName required | string Value: "createToken" |
| args required | Array of strings Arguments for token creation:
|
Responses
Request samples
- Payload
{- "scAddress": "klv1qqqqqqqqqqqqqpgq9696g7x76kwrrh02fahn4rpem4v595t8c0nqgxzpmu",
- "funcName": "createToken",
- "args": [
- "string:MyToken",
- "string:MTK",
- "u32:6",
- "BigUint:1000000000000",
- "u8:0"
]
}Response samples
- 200
{- "data": {
- "returnData": [
- "string"
], - "returnCode": "string",
- "returnMessage": "string"
}, - "error": "string",
- "code": "string"
}Mint Tokens
Mints new tokens to the contract address, increasing the total supply.
Process:
- Validates the caller has minting permissions
- Mints the specified amount of tokens
- 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/jsonrequired
| scAddress required | string Token Manager contract address |
| funcName required | string Value: "mint" |
| args required | Array of strings Arguments:
|
Responses
Request samples
- Payload
{- "scAddress": "klv1qqqqqqqqqqqqqpgq9696g7x76kwrrh02fahn4rpem4v595t8c0nqgxzpmu",
- "funcName": "mint",
- "args": [
- "string:MTK-A1B2",
- "BigUint:1000000000"
]
}Response samples
- 200
{- "data": {
- "returnData": [
- "string"
], - "returnCode": "string",
- "returnMessage": "string"
}, - "error": "string",
- "code": "string"
}Mint Tokens to Address
Mints new tokens directly to a specified address.
Process:
- Validates the caller has minting permissions
- Mints the specified amount of tokens
- 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/jsonrequired
| scAddress required | string Token Manager contract address |
| funcName required | string Value: "mintWithAddress" |
| args required | Array of strings Arguments:
|
Responses
Request samples
- Payload
{- "scAddress": "klv1qqqqqqqqqqqqqpgq9696g7x76kwrrh02fahn4rpem4v595t8c0nqgxzpmu",
- "funcName": "mintWithAddress",
- "args": [
- "string:MTK-A1B2",
- "BigUint:1000000000",
- "address:klv17e8zzgn73h6ehe3c6q9vlt77kuxk5euddmhymy5uhv2rhv0dc0nqlfp0ap"
]
}Response samples
- 200
{- "data": {
- "returnData": [
- "string"
], - "returnCode": "string",
- "returnMessage": "string"
}, - "error": "string",
- "code": "string"
}Burn Tokens
Burns tokens, permanently removing them from circulation and reducing total supply.
Process:
- Validates the caller has burn permissions
- Verifies sufficient token balance
- 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/jsonrequired
| scAddress required | string Token Manager contract address |
| funcName required | string Value: "burn" |
| args required | Array of strings Arguments:
|
Responses
Request samples
- Payload
{- "scAddress": "klv1qqqqqqqqqqqqqpgq9696g7x76kwrrh02fahn4rpem4v595t8c0nqgxzpmu",
- "funcName": "burn",
- "args": [
- "string:MTK-A1B2",
- "BigUint:500000000"
]
}Response samples
- 200
{- "data": {
- "returnData": [
- "string"
], - "returnCode": "string",
- "returnMessage": "string"
}, - "error": "string",
- "code": "string"
}Transfer Tokens
Transfers tokens from the contract to a specified address.
Process:
- Validates the caller has transfer permissions
- Verifies sufficient token balance in contract
- 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/jsonrequired
| scAddress required | string Token Manager contract address |
| funcName required | string Value: "transfer" |
| args required | Array of strings Arguments:
|
Responses
Request samples
- Payload
{- "scAddress": "klv1qqqqqqqqqqqqqpgq9696g7x76kwrrh02fahn4rpem4v595t8c0nqgxzpmu",
- "funcName": "transfer",
- "args": [
- "string:MTK-A1B2",
- "BigUint:100000000",
- "address:klv17e8zzgn73h6ehe3c6q9vlt77kuxk5euddmhymy5uhv2rhv0dc0nqlfp0ap"
]
}Response samples
- 200
{- "data": {
- "returnData": [
- "string"
], - "returnCode": "string",
- "returnMessage": "string"
}, - "error": "string",
- "code": "string"
}