- Project Overview
- Architecture
- Installation
- Configuration
- Usage
- Testing
- Security Considerations
- Audit Readiness
- Deployment
VCoin is a comprehensive Solana-based token project that provides a complete ecosystem for creating and managing SPL tokens. This project implements token creation, metadata management, token allocation, presale functionality, and vesting capabilities.
The project is designed with security, maintainability, and extensibility in mind, following best practices for Solana development.
- Token Creation: Create SPL tokens with customizable supply and decimals
- Metadata Management: Update token metadata on-chain
- Token Allocation: Distribute tokens according to a defined tokenomics model
- Presale Management: Run token presales with configurable parameters
- Vesting: Implement vesting schedules for token releases
The project follows a modular architecture, with clear separation of concerns between different components.
- Token Creation:
create-token.ts- Handles token creation and initial setup - Metadata Management:
update-metadata.ts- Manages on-chain metadata using Metaplex - Token Allocation:
allocate-token.ts- Distributes tokens according to tokenomics - Presale:
presale.ts- Manages token presale functionality - Vesting:
vesting.ts- Implements vesting schedules and release mechanisms - Utilities:
utils.ts- Common utilities used across the codebase
- Create a token using
create-token.ts - Update token metadata using
update-metadata.ts - Allocate tokens to different wallets using
allocate-token.ts - Run a presale using
presale.ts - Set up and manage vesting schedules using
vesting.ts
- Node.js (v16+)
- npm or yarn
- Solana CLI tools (optional, for interacting with the Solana network directly)
-
Clone the repository:
git clone <repository-url> cd vcoin
-
Install dependencies:
npm install
-
Copy the environment file and configure it:
cp .env.example .env
Configure the project by editing the .env file. Key parameters include:
SOLANA_NETWORK=devnet
SOLANA_RPC_URL=https://api.devnet.solana.com
TOKEN_NAME=VCoin
TOKEN_SYMBOL=VCN
TOKEN_DECIMALS=6
TOKEN_TOTAL_SUPPLY=1000000000
DEV_ALLOCATION=500000000
PRESALE_ALLOCATION=100000000
AIRDROP_ALLOCATION=50000000
VESTING_ALLOCATION=350000000
PRESALE_PRICE_USD=0.03
PRESALE_START_DATE=2025-03-15
PRESALE_END_DATE=2025-08-31
VESTING_RELEASE_AMOUNT=50000000
VESTING_RELEASE_INTERVAL_MONTHS=3
Create a new token with:
npm run create-tokenOptions:
--existing-keypair: Use an existing authority keypair--skip-balance-check: Skip the SOL balance check
Update token metadata with:
npm run update-metadata <mint-address> <metadata-path> [rpc-url] [keypair-path]Example:
npm run update-metadata 7KVJjSF9ZQ7LihvQUu9N7Gqq9P5thxYkDLeaGAriLuH ./token-metadata.jsonAllocate tokens according to tokenomics:
npm run allocate-tokensThis will distribute tokens to development, presale, airdrop, and vesting wallets based on your configuration.
Manage the presale with:
# Start the presale
npm run presale start
# End the presale
npm run presale end
# Process a purchase
npm run presale buy <buyer_address> <usd_amount>
# Check presale status
npm run presale statusManage vesting schedules:
# Initialize vesting schedule
npm run vesting init
# Execute a specific release
npm run vesting release <release_number>
# Check vesting status
npm run vesting statusThe project has comprehensive test coverage, including unit tests, integration tests, and E2E tests.
# Run all tests
npm test
# Run tests with coverage report
npm test -- --coverage
# Run specific test file
npm test -- --testPathPattern=tests/unit/utils.test.tsThe codebase maintains high test coverage:
- Statement coverage: 94.22%
- Branch coverage: 81.1%
- Function coverage: 95.55%
- Line coverage: 94.72%
- Input Validation: All user inputs are validated
- Path Traversal Protection: Prevents path traversal attacks in file operations
- Keypair Security: Secure handling of keypairs
- Metadata Integrity: Checksum verification for metadata
- Error Handling: Comprehensive error handling throughout the codebase
- Private keys are never stored in plaintext
- Authority verification for sensitive operations
- Limited scope for sensitive operations
- Principle of least privilege applied throughout
The project is ready for audit with the following characteristics:
- High Test Coverage: Exceeds 80% branch coverage target
- Comprehensive Testing: Unit, integration, and E2E tests
- Security-Focused Tests: Dedicated tests for security aspects
- Documentation: Well-documented code and functionality
- Error Handling: Robust error handling throughout
- Token transfer operations should be reviewed for edge cases
- Some deprecated configurations in Jest setup
- Some utility functions could benefit from additional test coverage
- Configure
.envto use Devnet - Ensure you have a funded Devnet wallet
- Run the appropriate scripts in sequence
For mainnet deployment:
- Update
.envto use mainnet configuration - Use a secure, air-gapped machine for keypair generation
- Ensure sufficient SOL balance for operations
- Double-check all configuration values
- Run a dry-run on Devnet first
- Follow the deployment sequence carefully
After deployment, verify:
- Token creation and metadata
- Token allocations
- Presale functionality
- Vesting schedule
This project is proprietary and confidential. All rights reserved.
© 2025 VCoin Project