TokenPlatform is a new Real-World Asset (RWA) Tokenization platform that demonstrates the implementation of ERC-3643 (T-REX) security token standards using modern blockchain technologies. This platform serves as an educational tool to showcase how enterprise-grade tokenization platforms work in practice.
This platform recreates actual enterprise tokenization behavior using:
- T-REX Factory for token creation and management
- OnchainID for identity verification and KYC management
- OpenZeppelin libraries for secure smart contract implementations
- ERC-3643 compliance for security token standards
The platform currently uses Account 0 on Hardhat to act as the platform manager, handling most core functions but not all platform capabilities. This design choice allows for educational demonstration while maintaining security.
- MetaMask Integration: Implement MetaMask for all transaction signings across the platform
- Multi-Factory Deployment: Deploy T-REX factory contracts for each individual issuer instead of shared platform factory
Shout out to the ERC-3643 Association for their pioneering work in establishing security token standards and making enterprise tokenization accessible to developers worldwide.
Before you begin, ensure you have the following installed on your system:
- Git (for cloning the repository)
- Node.js (v16 or higher) - for Hardhat and npm packages
- Python (3.8-3.11 recommended, 3.12+ supported with updated packages) - for Flask backend
- pip (Python package manager)
- GitHub account (for cloning)
Note: Python 3.12+ users may need to reinstall dependencies due to package compatibility changes.
Ubuntu/Debian:
# Update package list
sudo apt update
# Install Node.js and npm
sudo apt install nodejs npm
# Verify installation
node --version
npm --versionnpm install -g yarn yarn --version
# Clone the main repository
git clone https://github.com/BartKupc/TokenPlatform.git
# Navigate to the project directory
cd TokenPlatform# Install Hardhat and related packages
npm install
# Create a Python virtual environment
sudo apt install python3.12-venv
python3 -m venv venv
# Activate the virtual environment
# On Linux/Mac:
source venv/bin/activate
# On Windows:
# venv\Scripts\activate
# Install Python dependencies
pip install -r requirements.txt
**Note:** The requirements.txt contains only essential dependencies. Flask will automatically install its core dependencies (Werkzeug, Jinja2, etc.) when you install Flask.Before starting the platform, configure it for your environment:
cd TokenPlatform
echo "EXTERNAL_IP=127.0.0.1" > .env
node scripts/generate-flask-config.jscd TokenPlatform
echo "EXTERNAL_IP=************" > .env
node scripts/generate-flask-config.jsNote: Replace =************ with your actual EC2 public IP address.
Your platform comes with convenient shell scripts for easy startup:
# First time setup (run once)
./setup.sh
# Start the platform
./start.sh
# Restart the platform (stops, cleans, and starts)
./restart.sh
# Stop the platform
./stop.sh- Checks dependencies (virtual environment, Node.js modules)
- Starts Hardhat blockchain node
- Deploys T-REX factory contracts
- Launches Flask web application
Once started, open your web browser and navigate to:
http://localhost:5000
The platform comes with pre-configured Hardhat test accounts. After starting the application, you can:
- Register users with different roles (Investor, Issuer, Trusted Issuer)
- Deploy security tokens with T-REX compliance
- Test the complete investment flow from token creation to transfer
For detailed testing instructions, see the individual route documentation in the routes/ directory.
The platform includes a default admin account for initial setup:
- Username:
admin - Password:
admin123
- Navigate to
/admin/loginin your browser - Use the default credentials above
- Access the admin dashboard for:
- User management
- Platform oversight
- Compliance monitoring
- System administration
1. Port Already in Use
# Kill process using port 5000
lsof -ti:5000 | xargs kill -92. Database Locked
# Remove database file and recreate
rm fundraising.db
python -c "from app import app, db; app.app_context().push(); db.create_all()"3. Contract Deployment Failed
# Check Hardhat node is running
npx hardhat node
# Verify network configuration
npx hardhat run scripts/deploy.js --network localhost4. Python Dependencies Issues
# Recreate virtual environment
rm -rf venv
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt- ERC-3643 Documentation: Official T-REX Standard
- OnchainID: Identity Management
- OpenZeppelin: Smart Contract Libraries
- Hardhat: Development Framework
If you encounter issues:
- Check the troubleshooting section above
- Review the logs in your terminal
- Open an issue on GitHub
- Join our community discussions