Native Cross-Chain Token
#
PrerequisitesBefore you begin, make sure you have:
- Node.js (v20+) and npm
- Git
- A private key with testnet funds for deployment
- Testnet tokens for:
#
Step 1: Clone & Setup# Clone the repositorygit clone https://github.com/VIALabs-io/quickstart-token.git && cd quickstart-token
# Install dependenciesnpm install
# Create a .env file with your private keycp .env.example .env
#
Step 2: Deploy Your Tokennode scripts/deploy.js
#
Step 3: Bridge Tokens Between Networksnode scripts/bridge.js avalanche-testnet base-testnet 5
#
Step 4: Use the Frontend# Start the frontendcd frontendnpm installnpm start
๐ Congratulations! You've successfully created and used a cross-chain token.
Adding More Networks
#
Step 1: Edit Network ConfigurationEdit the network.config.js
file and add new network configurations:
// Add a new networkconst networks = { fuji: { name: 'avalanche-fuji', chainId: 43113, rpcUrl: process.env.AVALANCHE_FUJI_RPC || 'https://api.avax-test.network/ext/bc/C/rpc', blockExplorer: 'https://testnet.snowtrace.io', nativeCurrency: { name: 'AVAX', symbol: 'AVAX', decimals: 18 } }, sepolia: { name: 'base-sepolia', chainId: 84532, rpcUrl: process.env.BASE_SEPOLIA_RPC || 'https://sepolia.base.org', blockExplorer: 'https://sepolia-explorer.base.org', nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18 } }, // Add your new network here // Example for adding Polygon Mumbai: mumbai: { name: 'polygon-mumbai', chainId: 80001, rpcUrl: process.env.POLYGON_MUMBAI_RPC || 'https://rpc-mumbai.maticvigil.com', blockExplorer: 'https://mumbai.polygonscan.com', nativeCurrency: { name: 'MATIC', symbol: 'MATIC', decimals: 18 } }};
#
Step 2: Deploynode scripts/deploy.js
Next Steps
Create Cross-Chain NFTs
Learn how to create NFTs that can move between different blockchains.
Learn More โ
Build a Cross-Chain Oracle
Connect your smart contracts to off-chain data sources across multiple chains.
Learn More โ
Learn About VIA Labs Architecture
Understand the technical details behind VIA Labs' cross-chain infrastructure.
Learn More โ
Need Help? Join our Discord community for support and discussions.