Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.

Alpha4-Labs/contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Alpha Points Protocol - Smart Contracts

License Move

This repository contains the Alpha Points Protocol smart contracts implementation for the Sui blockchain. The protocol enables the minting, management, and redemption of Alpha Points - account-bound units of cross-chain liquidity and loyalty - secured by object-isolated stakes on Sui.

πŸ—οΈ Repository Structure

β”œβ”€β”€ sources/           # Move smart contract source files
β”‚   β”œβ”€β”€ admin.move            # Protocol administration & governance
β”‚   β”œβ”€β”€ ledger.move           # Point accounting & balance management  
β”‚   β”œβ”€β”€ escrow.move           # Asset custody & vault management
β”‚   β”œβ”€β”€ stake_position.move   # Individual stake objects
β”‚   β”œβ”€β”€ oracle.move           # Price feeds & conversion rates
β”‚   β”œβ”€β”€ integration.move      # Main protocol entry points
β”‚   β”œβ”€β”€ partner.move          # Partner management system
β”‚   β”œβ”€β”€ partner_flex.move     # Flexible partner configurations
β”‚   β”œβ”€β”€ partner_yield.move    # Partner yield calculations
β”‚   β”œβ”€β”€ perk_manager.move     # Perk creation & redemption
β”‚   β”œβ”€β”€ generation_manager.move # Generation-based rewards
β”‚   β”œβ”€β”€ staking_manager.move  # Staking operations
β”‚   β”œβ”€β”€ loan.move             # Lending against stakes
β”‚   └── ...
β”œβ”€β”€ tests/             # Move unit tests
β”œβ”€β”€ Move.toml          # Package manifest
└── Move.lock          # Dependency lock file

🧩 Core Protocol Modules

Essential Infrastructure

  • admin.move - Configuration, capabilities, and emergency controls
  • ledger.move - Global Alpha Point supply and user balance accounting
  • escrow.move - Secure custody of underlying assets backing points
  • oracle.move - External price feeds and conversion rate management

User-Facing Operations

  • integration.move - Main protocol interface for users and applications
  • stake_position.move - Individual stake representations as Sui objects
  • staking_manager.move - Staking lifecycle management

Partner & Rewards System

  • partner.move - Partner onboarding and management
  • partner_flex.move - Flexible partner reward configurations
  • partner_yield.move - Partner-specific yield calculations
  • perk_manager.move - Perk creation, pricing, and redemption
  • generation_manager.move - Generation-based reward distributions

Advanced Features

  • loan.move - Collateralized lending against staked positions
  • pending_withdrawals_manager.move - Withdrawal queue management

⚑ Key Features

Account-Bound Points

  • Points are non-transferable by design, tied to user addresses
  • Prevents gaming through wash trading or artificial transfers
  • Maintains authentic engagement tracking

Object-Centric Security

  • Each stake is its own StakePosition object with the key ability
  • Compromise blast-radius is limited to individual objects
  • Enhanced security through isolation

Flexible Partner Integration

  • Partners can integrate using stable APIs without core modifications
  • Configurable reward parameters and perk systems
  • Generation-based and yield-based reward models

Upgradability & Governance

  • Package uses upgrade capabilities for compatible improvements
  • Governance controls through capability objects
  • Emergency pause functionality for security

πŸ“Š Points Generation Formula

points = principal Γ— participation Γ— time_weight Γ— (1 / liquidity_dom)

This formula is implemented as pure Move math inside the ledger module for deterministic, on-chain results.

πŸ”§ Development Setup

Prerequisites

  • Sui CLI installed
  • Move development environment configured

Building the Contracts

# Clone the repository
git clone https://github.com/Alpha4-Labs/contracts.git
cd contracts

# Build the Move package
sui move build

# Run tests
sui move test

Testing

The tests/ directory contains comprehensive unit tests for all modules:

# Run specific test module
sui move test --test admin_tests

# Run all tests with coverage
sui move test --coverage

πŸš€ Deployment Phases

  1. Ξ±-0 Core Ledger - Basic points accounting βœ…
  2. Ξ±-1 Stake + Escrow - Full staking and redemption flows βœ…
  3. Ξ±-2 Partner System - Partner integration and perk management βœ…
  4. Ξ±-3 Loan Module - Early-exit capability via loans βœ…
  5. Ξ±-4 Advanced Features - Generation management and yield optimization βœ…

πŸ”’ Security Features

  • Emergency Controls - Protocol-wide pause functionality
  • Capability-Based Access - Explicit authorization through capability objects
  • Comprehensive Events - Full event emission for all state changes
  • Extensive Testing - Complete test coverage across all modules
  • Error Handling - Descriptive error codes and proper error management

πŸ”— Related Repositories

This contracts repository is part of the larger Alpha Points ecosystem:

  • Frontend Application - User dashboard and staking interface
  • Partner Dashboard - Partner management and analytics
  • Rewards Marketplace - Perk browsing and redemption
  • SDK - JavaScript/TypeScript integration library
  • Documentation - Protocol specifications and guides

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and add tests
  4. Ensure all tests pass: sui move test
  5. Commit your changes: git commit -m 'Add amazing feature'
  6. Push to the branch: git push origin feature/amazing-feature
  7. Open a Pull Request

πŸ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

πŸ†˜ Support

  • Issues - Report bugs or request features via GitHub Issues
  • Documentation - Check our comprehensive docs repository
  • Community - Join our Discord for discussions and support

Alpha4 Labs - Building the future of cross-chain liquidity and engagement rewards.

About

Alpha4 - Open Loop Reward System on Sui - Smart Contracts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published