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.
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:
A wallet with
tKUBfor KUB Testnet from the KUB Faucet (orKUBfor KUB Mainnet)Node.js and a package manager such as
npm,pnpm, oryarnKAP contracts from @kub-chain/contracts
KUB network details from Connect to KUB
KAP Infrastructure Contract Addresses
Use these values when preparing deployment inputs.
projectName
kap20-token
kyc
0x409CF41ee862Df7024f289E9F2Ea2F5d0D7f3eb4
adminProjectRouter
0x15122c945763da4435b45E082234108361B64eBA
committee
0x5106ffca7cC44E6cFfEE9bD016A0934130b0322f
transferRouter
0xFbf5b70ef07AE6F64D3796f8a0fE83A3579FAb6f
acceptedKYCLevel
4
projectName
kap20-token
kyc
0x988bC9c05f0e0fBC198a5DB0Bd62ca90DC3e1b05
adminProjectRouter
0x6F0f1CAfE5560d9658833490eE999fa731708346
committee
Your Developer Address
transferRouter
0x4d61aFc68520E0f0Ccbd1A599dd0dC97E2B3B04B
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.
Set the Solidity version to ^0.8.0 (e.g., 0.8.20). A version mismatch results in a compilation failure.
Step 4: Set the constructor and mint inputs
Prepare these values before deployment. Review the token interface definitions in the KAP Token Interfaces section.
namesymboldecimalsinitialSupplyprojectNamekycadminProjectRoutercommitteetransferRouteracceptedKYCLevel
Step 5: Deploy to KUB Testnet
Example Hardhat Deployment Call
Example Hardhat Deployment Script
Example Foundry Deployment Call
For Remix IDE
Open Deploy & Run Transactions.
Set Environment to Injected Provider - MetaMask.
Select your compiled token contract.
Enter the constructor arguments for KUB Testnet.
Confirm that MetaMask is connected to KUB Testnet.
Click Deploy, then confirm the transaction in your wallet.
Copy the deployed contract address from Deployed Contracts or the Remix terminal.
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:
transferapprovetransferFromadminTransfer
If your contract integrates KYC-gated flows, also test
internalTransferexternalTransfer
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
Switch MetaMask to KUB Mainnet.
Update the constructor arguments to the KUB Mainnet values.
Open Deploy & Run Transactions and confirm the Environment is still Injected Provider - MetaMask.
Select the same compiled contract used on testnet.
Deploy again from Deploy & Run Transactions.
Confirm the transaction in MetaMask.
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