Enterprise-grade infrastructure for tokenizing real-world assets on Mantle
The Mantle RWA SDK is a comprehensive toolkit for building compliant, tokenized real-world asset (RWA) applications on the Mantle blockchain. It provides smart contracts, a TypeScript SDK, and a production-ready dashboard for managing identity, compliance, and asset deployment.
- Identity Management: Built-in KYC/AML verification system with country-based restrictions
- Compliance Engine: Flexible compliance rules for accredited investors, KYC requirements, and geographic restrictions
- Asset Factory: Gas-efficient deployment of RWA tokens using minimal proxy pattern
- Security First: Built on OpenZeppelin contracts with role-based access control
- Dashboard UI: Production-ready Next.js dashboard for managing assets and identities
- TypeScript SDK: Fully typed SDK for seamless integration
- Multi-Chain Ready: Deploy on Mantle Sepolia, Mantle Mainnet, or any EVM chain
┌─────────────────────────────────────────────────────────────┐
│ Mantle RWA SDK │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Identity │ │ Compliance │ │ Asset │ │
│ │ Registry │ │ Registry │ │ Factory │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │ │ │
│ └──────────────────┴──────────────────┘ │
│ │ │
│ ┌─────────▼─────────┐ │
│ │ RWA Token │ │
│ │ (ERC-20 + │ │
│ │ Compliance) │ │
│ └──────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────┐ │
│ │ TypeScript SDK (@mantle-rwa/sdk) │ │
│ └────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────┐ │
│ │ Next.js Dashboard (apps/dashboard) │ │
│ └────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
- Node.js 18+ and npm/yarn/pnpm
- Foundry (for contract development)
- A wallet with testnet ETH (for deployment)
# Clone the repository
git clone https://github.com/your-org/mantle-rwa-sdk.git
cd mantle-rwa-sdk
# Install dependencies
npm install
# Build the SDK
npm run build:sdkcd packages/contracts
# Set up environment
cp .env.example .env
# Edit .env with your PRIVATE_KEY and RPC_URL
# Deploy to Mantle Sepolia
forge script script/DeployMantleSepolia.s.sol:DeployMantleSepolia \
--rpc-url $MANTLE_SEPOLIA_RPC_URL \
--private-key $PRIVATE_KEY \
--broadcast \
-vvvvcd apps/dashboard
# Copy environment template
cp .env.example .env.local
# Update with your deployed contract addresses
# See DEPLOYMENT.md for detailscd apps/dashboard
npm install
npm run devVisit http://localhost:3000 to access the dashboard.
mantle-rwa-sdk/
├── apps/
│ ├── dashboard/ # Next.js dashboard application
│ │ ├── src/
│ │ │ ├── app/ # Next.js app router pages
│ │ │ ├── components/ # React components
│ │ │ └── lib/ # Utilities and config
│ │ └── package.json
│ └── mcp-server/ # MCP server (future)
│
├── packages/
│ ├── contracts/ # Solidity smart contracts
│ │ ├── src/
│ │ │ ├── IdentityRegistry.sol
│ │ │ ├── ComplianceRegistry.sol
│ │ │ ├── AssetFactory.sol
│ │ │ └── RWAToken.sol
│ │ ├── script/ # Deployment scripts
│ │ └── test/ # Foundry tests
│ │
│ └── sdk/ # TypeScript SDK
│ ├── src/
│ │ ├── core/ # SDK core logic
│ │ ├── abis/ # Contract ABIs
│ │ └── types/ # TypeScript types
│ └── package.json
│
├── scripts/ # Utility scripts
├── README.md # This file
├── DEPLOYMENT.md # Deployment guide
└── package.json # Root workspace config
Manages KYC/AML status and country codes for addresses.
Key Features:
- Country code mapping (ISO 3166-1 numeric)
- Claims bitmap for verification levels (KYC, Accredited, etc.)
- Role-based access control (REGISTRAR_ROLE)
Usage:
// Register an identity
await sdk.registerIdentity(
'0xUserAddress',
840, // Country code (US)
5n // Claims: KYC (1) + Accredited (4)
);Defines and enforces compliance rules for asset transfers.
Key Features:
- Rule-based compliance checking
- Accredited investor requirements
- KYC level requirements
- Country-based restrictions
Usage:
// Check compliance
const isCompliant = await sdk.complianceRegistry.read.checkCompliance([
'0xUserAddress',
'0xRuleId'
]);Gas-efficient factory for deploying new RWA tokens.
Key Features:
- Minimal proxy pattern (Clones)
- Automatic role assignment
- Compliance rule binding
Usage:
// Deploy a new asset
const txHash = await sdk.deployAsset(
"Real Estate Fund 1",
"REF1",
"0xRuleId",
1000000n
);ERC-20 compatible token with built-in compliance checks.
Key Features:
- ERC-20 standard compliance
- Transfer restrictions based on compliance rules
- Pausable functionality
- Document management (ERC-1643 style)
- Legal recovery (force transfer)
npm install @mantle-rwa/sdk viemimport { MantleRWASDK } from '@mantle-rwa/sdk';
import { createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { mantleSepoliaTestnet } from 'viem/chains';
// Initialize SDK
const account = privateKeyToAccount('0x...');
const walletClient = createWalletClient({
account,
chain: mantleSepoliaTestnet,
transport: http()
});
const sdk = new MantleRWASDK({
chain: mantleSepoliaTestnet,
rpcUrl: 'https://rpc.sepolia.mantle.xyz',
walletClient,
contractAddresses: {
identityRegistry: '0x...',
complianceRegistry: '0x...',
assetFactory: '0x...'
}
});
// Deploy an asset
const txHash = await sdk.deployAsset(
"Mantle Gold",
"mGLD",
keccak256(toBytes("US_ACCREDITED")),
0n
);
// Interact with deployed token
const token = sdk.getRWAToken('0xTokenAddress');
const balance = await token.read.balanceOf(['0xUserAddress']);See packages/sdk/README.md for complete SDK documentation.
After deployment, update your .env.local with:
NEXT_PUBLIC_IDENTITY_REGISTRY_ADDRESS=0x...
NEXT_PUBLIC_COMPLIANCE_REGISTRY_ADDRESS=0x...
NEXT_PUBLIC_ASSET_FACTORY_ADDRESS=0x...
NEXT_PUBLIC_RWA_TOKEN_IMPLEMENTATION_ADDRESS=0x...- Audited Libraries: Built on OpenZeppelin contracts
- Access Control: Role-based permissions throughout
- Upgradeable: RWAToken uses upgradeable pattern
- Gas Optimized: Minimal proxy pattern for asset deployment
See packages/contracts/README.md for contract documentation.
The dashboard provides a complete UI for:
- Identity Management: View and update KYC/AML status
- Asset Deployment: Deploy new RWA tokens
- Compliance Rules: Create and manage compliance policies
- Asset Management: Mint, pause, and manage tokens
- Portfolio View: Track your RWA holdings
- Modern, responsive UI with 3D animations
- WalletConnect integration
- Real-time contract data
- Role-based access control
- Mobile-friendly design
# Install dependencies
npm install
# Build all packages
npm run build:sdk
npm run build:dashboard
# Run tests
npm run test:contracts# SDK
npm run build:sdk # Build SDK package
npm run dev:sdk # Watch mode for SDK
# Dashboard
npm run dev:dashboard # Start dashboard dev server
npm run build:dashboard # Build dashboard for production
# Contracts
npm run test:contracts # Run Foundry tests
npm run build:contracts # Compile contractscd packages/contracts
forge testcd packages/contracts
forge test --match-path test/integration/*See DEPLOY_TO_MANTLE_SEPOLIA.md for step-by-step instructions.
See DEPLOYMENT.md for deployment options (Vercel, Docker, etc.).
- SDK Documentation: Complete SDK API reference
- Contract Documentation: Smart contract details
- Deployment Guide: Production deployment instructions
- Mantle Sepolia Deployment: Testnet deployment guide
Contributions are welcome! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Write tests for new features
- Update documentation
- Follow Solidity style guide
- Ensure all tests pass
If you discover a security vulnerability, please email security@example.com. Do not open a public issue.
This project is licensed under the MIT License - see the LICENSE file for details.
- Mainnet deployment
- Additional compliance rule types
- Multi-signature support
- Gas optimization improvements
- Enhanced dashboard features
- Mobile SDK
- MCP server implementation
- Built on Mantle Network
- Uses OpenZeppelin Contracts
- Powered by Viem and Wagmi
Built for the decentralized future