Quick Start
Deploy your first compliant RWA token on Mantle Network in under 10 minutes. This guide walks you through the essential steps from setup to deployment.
Prerequisites Checklistā
Before starting, ensure you have:
- Node.js 18+ installed (Installation guide)
- A code editor (VS Code recommended)
- A wallet with testnet MNT tokens
- Basic TypeScript knowledge
Get free testnet MNT from the Mantle Sepolia Faucet.
Step 1: Create a New Projectā
Create a new directory and initialize your project:
mkdir my-rwa-project
cd my-rwa-project
npm init -y
Install the required dependencies:
npm install @mantle-rwa/sdk viem dotenv typescript tsx
Initialize TypeScript:
npx tsc --init
Step 2: Configure Environmentā
Create a .env file for your private key:
PRIVATE_KEY=your_wallet_private_key_here
Never commit your .env file to version control. Add it to .gitignore:
echo ".env" >> .gitignore
Step 3: Initialize the SDKā
Create your first script to initialize the SDK:
import 'dotenv/config';
import { RWAClient } from '@mantle-rwa/sdk';
// Validate environment
if (!process.env.PRIVATE_KEY) {
throw new Error('PRIVATE_KEY environment variable is required');
}
// Initialize the SDK client
const client = new RWAClient({
network: 'mantle-sepolia', // Use testnet for development
privateKey: process.env.PRIVATE_KEY,
});
console.log('ā
SDK initialized successfully');
console.log('š Network:', client.network);
console.log('š Address:', client.address);
Run the script to verify your setup:
npx tsx src/deploy.ts
You should see output like:
ā
SDK initialized successfully
š Network: mantle-sepolia
š Address: 0x...
Step 4: Deploy Your RWA Systemā
Now let's deploy a complete RWA token system. Add the deployment code:
import 'dotenv/config';
import { RWAClient } from '@mantle-rwa/sdk';
if (!process.env.PRIVATE_KEY) {
throw new Error('PRIVATE_KEY environment variable is required');
}
const client = new RWAClient({
network: 'mantle-sepolia',
privateKey: process.env.PRIVATE_KEY,
});
async function main() {
console.log('š Deploying RWA System...\n');
// Deploy the complete RWA system
const deployment = await client.deployRWASystem({
// Token configuration
tokenName: 'My First RWA Token',
tokenSymbol: 'MFRWA',
initialSupply: '1000000', // 1 million tokens
// Compliance configuration
compliance: {
maxHolders: 500,
minInvestment: '100', // Minimum 100 tokens
maxInvestment: '100000', // Maximum 100k tokens
},
});
console.log('ā
Deployment successful!\n');
console.log('š Contract Addresses:');
console.log(' Token:', deployment.token.address);
console.log(' KYC Registry:', deployment.kycRegistry.address);
console.log(' Yield Distributor:', deployment.yieldDistributor.address);
console.log(' Asset Vault:', deployment.assetVault.address);
console.log('\nš View on Explorer:');
console.log(` https://sepolia.mantlescan.xyz/address/${deployment.token.address}`);
}
main().catch(console.error);
Run the deployment:
npx tsx src/deploy.ts
The deployment typically takes 30-60 seconds as it deploys multiple contracts.
Step 5: Verify Your Deploymentā
After deployment, you can verify your token on the Mantle Sepolia explorer. The script outputs a direct link to your token contract.
You can also interact with your deployed contracts:
import 'dotenv/config';
import { RWAClient } from '@mantle-rwa/sdk';
const client = new RWAClient({
network: 'mantle-sepolia',
privateKey: process.env.PRIVATE_KEY!,
});
async function main() {
// Connect to your deployed token
const token = client.token('YOUR_TOKEN_ADDRESS');
// Get token info
const name = await token.name();
const symbol = await token.symbol();
const totalSupply = await token.totalSupply();
console.log('Token Info:');
console.log(' Name:', name);
console.log(' Symbol:', symbol);
console.log(' Total Supply:', totalSupply);
// Check your balance
const balance = await token.balanceOf(client.address);
console.log(' Your Balance:', balance);
}
main().catch(console.error);
What's Next?ā
Congratulations! You've deployed your first RWA token system. Here's what to explore next:
Immediate Next Stepsā
- Configure KYC - Set up investor verification
- Mint Tokens - Issue tokens to verified investors
- Distribute Yield - Set up yield payments
Learn Moreā
- Architecture Overview - Understand the system design
- API Reference - Explore all SDK methods
- React Components - Build UIs with pre-built components
Example Projectsā
- Real Estate Tokenization - Complete property tokenization example
- Private Equity - Fund tokenization with lock-up periods
- Full-Stack App - Complete application with frontend
Troubleshootingā
"Insufficient funds" Errorā
Ensure your wallet has enough testnet MNT for gas fees. Get tokens from the faucet.
"Invalid private key" Errorā
Check that your private key:
- Starts with
0x - Is 66 characters long (including
0x) - Is correctly copied without extra spaces
Transaction Timeoutā
If transactions are timing out:
- Check the Mantle network status
- Try increasing the gas limit in your configuration
- Wait a few minutes and retry
Need Help?ā
- Check the GitHub Discussions for community support
- Check the FAQ for common questions
- Open an issue on GitHub