Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Ž CRY Token Ledger

ICRC-1 Token Infrastructure for the Overworked Metaverse

License: MIT Internet Computer ICRC-1 ICRC-2 DFX

🌐 Part of the Overworked Metaverse ecosystem

Foundational token infrastructure for virtual economies πŸ’Όβœ¨


🎯 Overview

This repository contains the ICRC-1 ledger deployment infrastructure for the CRY Token - the native cryptocurrency of the Overworked Metaverse.

The CRY Token powers a revolutionary virtual world where users earn real value through:

  • πŸ’Ό Job Marketplace - Get paid in CRY for completing virtual tasks
  • πŸŽ“ Education Hubs - Earn tokens while learning new skills
  • πŸ›οΈ Museums & Culture - Monetize cultural experiences and content creation
  • 🏒 Virtual Offices - Facilitate real business operations in the metaverse
  • πŸ›οΈ Marketplace - Trade virtual assets and services

πŸ“ Note: The main token logic and smart contracts are implemented in the Overworked Metaverse backend. This repository focuses solely on ledger deployment and configuration.

✨ What This Repository Provides

πŸ—οΈ Ledger Infrastructure

  • ICRC-1 Ledger Deployment - Standard-compliant token ledger
  • ICP Ledger Integration - Local development with ICP compatibility
  • NNS Setup - Network Nervous System for testing environments

πŸ› οΈ Deployment Automation

  • One-command deployment - Automated setup scripts
  • Environment management - Configurable for different networks
  • Account management - Automated minter and controller setup

⚑ Standards Compliance

  • ICRC-1 compatible for seamless integration
  • ICRC-2 support for advanced token operations
  • Cross-ledger compatibility with other IC tokens

πŸ—οΈ Architecture

graph TB
    A[�️ CRY Token Ledger Repo] --> B[πŸ“‹ ICRC-1 Ledger]
    A --> C[πŸ“‹ ICP Ledger - Local]
    A --> D[πŸ”§ Deployment Scripts]
    B --> E[🌐 Overworked Backend]
    C --> E
    E --> F[πŸ’Ό Job System]
    E --> G[πŸŽ“ Education Hub]
    E --> H[πŸ›οΈ Museums]
    E --> I[🏒 Virtual Offices]
    
    style A fill:#e1f5fe
    style B fill:#e8f5e8
    style C fill:#e8f5e8
    style E fill:#f3e5f5
Loading

πŸš€ Quick Start

πŸ“‹ Prerequisites

  • dfx >= 0.27.0
  • WSL2 (for Windows users)
  • Git

πŸ› οΈ Installation

# Clone the repository
git clone https://github.com/Unchainers/CRY-Token.git
cd CRY-Token

# Install dfx if not already installed
sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"

# Setup environment variables
cp .bash.env.template .bash.env
# Edit .bash.env with your configuration

🌐 Local Development

# Start local replica
dfx start --background

# Deploy with temporary accounts (development only)
./deploy_ledger.bash --temp-acc

# Deploy with specific owners
./deploy_ledger.bash --set-owners <ICP_OWNER> <CRY_OWNER>

# Deploy using current identity
./deploy_ledger.bash --with-redeem

οΏ½ Configuration Options

Option Description Usage
--temp-acc πŸ§ͺ Create temporary test accounts Development only
--set-owners πŸ‘₯ Set specific owner principals --set-owners <icp> <cry>
--with-redeem πŸ”‘ Use current identity as owner Single command setup

πŸ“Š Deployed Canisters

After successful deployment, you'll have:

πŸͺ™ ICRC-1 Ledger Canister

  • Purpose: Main CRY token ledger
  • Standard: ICRC-1/ICRC-2 compliant
  • Functions: Transfer, balance queries, allowances
  • Integration: Used by Overworked backend

πŸ’° ICP Ledger Canister (Local only)

  • Purpose: Local ICP simulation for testing
  • Standard: ICP ledger compatible
  • Functions: ICP transfers and balance management
  • Usage: Development and testing only

πŸ’° Token Configuration

Parameter Value Description
Symbol CRY Token ticker symbol
Name CRY Token Full token name
Decimals 8 Precision (like Bitcoin)
Supply 1,000,000 Initial pre-minted tokens
Transfer Fee 0 No fees for basic transfers

🌟 Integration with Overworked

πŸ”— How It Connects

The ledger deployed by this repository is consumed by the main Overworked Metaverse backend for:

  • πŸͺ Token Vending Machine - ICP to CRY exchange
  • πŸ”„ P2P Token Swaps - User-to-user trading
  • πŸ’Ό Job Payments - Automated salary distribution
  • πŸŽ“ Education Rewards - Learning incentives
  • πŸ›οΈ Marketplace Transactions - Virtual asset trading

πŸ“‹ Environment Variables

After deployment, these variables are available for the main project:

# Auto-generated in .env file
CANISTER_ID_ICRC1_LEDGER_CANISTER=<ledger-canister-id>
CANISTER_ID_ICP_LEDGER_CANISTER=<icp-canister-id>
DFX_NETWORK=local

πŸ”— Usage Examples

Get Canister IDs

# Check deployed canister IDs
dfx canister id icrc1_ledger_canister
dfx canister id icp_ledger_canister

Check Token Balance

# Use the balance checker utility
./wheretoken.bash

# Or manually query
dfx canister call icrc1_ledger_canister icrc1_balance_of '(record { owner = principal "user-principal-here" })'

Integration in Main Project

// In Overworked backend - reference the deployed ledger
let cryLedger : ICRC1.Service = actor("canister-id-from-env");

// Use the ledger for transfers
let result = await cryLedger.icrc1_transfer({
    to = { owner = userPrincipal; subaccount = null };
    amount = rewardAmount;
    fee = null;
    memo = null;
    created_at_time = null;
});

πŸ“ Project Structure

CRY-Token/
β”œβ”€β”€ πŸ“„ README.md                    # This file
β”œβ”€β”€ βš™οΈ dfx.json                     # DFX configuration for ledgers
β”œβ”€β”€ πŸ”§ deploy_ledger.bash           # Main deployment script
β”œβ”€β”€ πŸ“Š .bash.env.template           # Environment template
β”œβ”€β”€ πŸ“Š .bash.env                    # Your environment config
β”œβ”€β”€ πŸ—‚οΈ src/
β”‚   └── πŸ“‹ declarations/            # Generated type definitions
β”œβ”€β”€ πŸ“œ setup.txt                    # Troubleshooting guide
β”œβ”€β”€ πŸ” wheretoken.bash              # Balance checking utility
└── πŸ“ *.log                        # Deployment logs

πŸ§ͺ Testing & Utilities

πŸ” Check Balances Across All Identities

# Run the balance checker
./wheretoken.bash

🎯 Test Token Operations

# Check total supply
dfx canister call icrc1_ledger_canister icrc1_total_supply

# Check token metadata
dfx canister call icrc1_ledger_canister icrc1_metadata

πŸ“Š Monitor Deployment

# Check deployment logs
tail -f nns_install.log
tail -f bishop.log

πŸš€ Deployment

🏠 Local Testing

# Use local replica
export DFX_NETWORK=local
./deploy_ledger.bash --temp-acc

⚠️ Important Notes

οΏ½ Security Considerations

  • Never use --temp-acc for mainnet deployment
  • Keep your principal keys secure
  • Use proper identity management for production

�️ Development Workflow

  1. Deploy ledger infrastructure (this repo)
  2. Copy canister IDs to main project
  3. Integrate with Overworked backend
  4. Test end-to-end functionality

πŸ“ Troubleshooting

Common issues and solutions are documented in setup.txt

🀝 Contributing

We welcome contributions to the CRY Token ledger infrastructure!

πŸ› οΈ Development Workflow

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/ledger-improvement)
  3. ✍️ Commit your changes (git commit -m 'Improve ledger deployment')
  4. πŸ“€ Push to the branch (git push origin feature/ledger-improvement)
  5. οΏ½ Open a Pull Request

πŸ“ Code Standards

  • Follow bash scripting best practices
  • Test deployment scripts thoroughly
  • Document environment variable changes
  • Use meaningful commit messages

πŸ“ž Support & Community

πŸ™ Acknowledgments

  • πŸ—οΈ Internet Computer Foundation - For the incredible ICP infrastructure
  • πŸ”§ DFINITY - For the ICRC standards and development tools
  • 🌟 IC Community - For continuous support and feedback

About

Each effort that you give paid off by CRY Token πŸ”₯

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages