For the complete documentation index, see llms.txt. This page is also available as Markdown.

Launch a KAP Token

Use this guide to launch a KAP standard token on KUB with the published @kub-chain/contracts package. It helps you choose the right KAP token standard, prepare the required KUB network inputs, and import the official KAP implementations into your project. Use the table below to map each KAP standard to its package path before you build or deploy.

Standard
Package Path

KAP-20

@kub-chain/contracts/contracts/token/KAP-20/

KAP-22

@kub-chain/contracts/contracts/token/KAP-22/

KAP-721

@kub-chain/contracts/contracts/token/KAP-721/

KAP-1155

@kub-chain/contracts/contracts/token/KAP-1155/

Deploy to KUB Testnet first. Move to KUB Mainnet only after you validate deployment, transfers, access control, and admin behavior.

Prerequisites

Prepare these before you deploy:

KAP Infrastructure Contract Addresses

Use these values when preparing deployment inputs.

Property
Value

projectName

kap20-token

kyc

0x409CF41ee862Df7024f289E9F2Ea2F5d0D7f3eb4

adminProjectRouter

0x15122c945763da4435b45E082234108361B64eBA

committee

0x5106ffca7cC44E6cFfEE9bD016A0934130b0322f

transferRouter

0xFbf5b70ef07AE6F64D3796f8a0fE83A3579FAb6f

acceptedKYCLevel

4

Example: Deploying KAP-20 Token

This example provides step-by-step instructions for deploying a KAP-20 token. For other token standards, you may follow the same deployment pattern. Make sure to review the KAP token interfaces before deploying your token.

Step-by-Step Deployment for KUB Testnet

Step 1: Configure the network

Example Hardhat Network Configuration

Example Foundry RPC Configuration

If you use the Remix IDE, switch the environment to Injected Provider - MetaMask and connect to the KUB Testnet as described in this guide.

Step 2: Install the package

Install the published contracts package in your project.

Import the KAP-20 base contract into your token contract.

If you build with Foundry, add a remapping by creating or editing remappings.txt at the project root.

Then use the same import path in your Solidity files.

Run your package manager install before forge build, so Foundry can resolve node_modules.

If you use Remix IDE, work from a local project that already has @kub-chain/contracts installed, then compile the same import path there.

Step 3: Compile the contract

Compile using the Solidity version required by the KAP contract you imported.

Example Hardhat Command

Example Foundry Command

In Remix IDE, open the Solidity Compiler tab, set the version to 0.8.20 and compile.

Step 4: Set the constructor and mint inputs

Prepare these values before deployment. Review the token interface definitions in the KAP Token Interfaces section.

  • name

  • symbol

  • decimals

  • initialSupply

  • projectName

  • kyc

  • adminProjectRouter

  • committee

  • transferRouter

  • acceptedKYCLevel

Step 5: Deploy to KUB Testnet

Example Hardhat Deployment Call

Example Hardhat Deployment Script

Example Foundry Deployment Call

For Remix IDE

  1. Open Deploy & Run Transactions.

  2. Set Environment to Injected Provider - MetaMask.

  3. Select your compiled token contract.

  4. Enter the constructor arguments for KUB Testnet.

  5. Confirm that MetaMask is connected to KUB Testnet.

  6. Click Deploy, then confirm the transaction in your wallet.

  7. Copy the deployed contract address from Deployed Contracts or the Remix terminal.

  8. Save the deployment transaction hash for later verification.

Step 6: Validate on KUB Testnet

Check the deployed token before deploying to the KUB Mainnet.

Then test the following:

  • transfer

  • approve

  • transferFrom

  • adminTransfer

If your contract integrates KYC-gated flows, also test

  • internalTransfer

  • externalTransfer

Keep the deployed address and constructor values. You will need them again for verification.

Step 7: Deploy to KUB Mainnet

After testnet validation, update your deployment inputs for KUB Mainnet and redeploy.

Example Hardhat Command

Example Foundry Command

For Remix IDE

  1. Switch MetaMask to KUB Mainnet.

  2. Update the constructor arguments to the KUB Mainnet values.

  3. Open Deploy & Run Transactions and confirm the Environment is still Injected Provider - MetaMask.

  4. Select the same compiled contract used on testnet.

  5. Deploy again from Deploy & Run Transactions.

  6. Confirm the transaction in MetaMask.

  7. Save the new contract address from the Remix terminal, Deployed Contracts, or MetaMask activity.

Step 8: Verify on KUB Scan

Verify the deployed contract on KUB Scan after deployment. If you deployed with Remix IDE, use the same compiler version and optimization settings that you used in the Solidity Compiler tab. KUB Scan supports viewing, verifying, and interacting with contract source code. See Block Explorer for more information.

Explorers:

Keep these values ready:

  • Contract Address

  • Compiler Version

  • Exact Source Files

  • Constructor Arguments

Post-Deployment

After deployment and verification, it is essential to confirm the token metadata in the block explorer. Be sure to record important details such as the contract address, deployment transaction hash, ABI, and source version. Once these details are documented, import the token into your wallet for testing purposes. It is crucial to test user-facing transfers and allowances to ensure everything functions correctly. Additionally, monitoring relevant Transfer and Approval events will help ensure that the token operates as intended.

Last updated