Skip to content

0x00000002/token-staking

Repository files navigation

Token Staking System

A secure, modular staking platform for tokens with time-locked commitments and a highly flexible reward system.

To see the system's structure, view the System Architecture Diagram →

Getting Started

To get started, find the path that best describes you:


System Overview

This staking platform is built with three core principles: security, data integrity, and developer-friendliness.

Key Features

  • Security First: Multi-layered security with role-based access control, including a dedicated MULTISIG_ROLE for critical recovery operations. It is protected from reentrancy attacks and can be paused in emergencies.
  • Flexible Reward System: A fully modular reward architecture with distinct contracts for scheduling (PoolManager), orchestration (RewardManager), and claim history (ClaimsJournal). This allows for creating complex reward scenarios with different strategies.
  • Advanced Data Management: Uses a checkpoint system for highly-efficient historical balance queries (O(log n)), which provides the necessary data for fair and accurate reward calculations.
  • Developer Friendly: A clear separation of concerns between the staking core and the reward system, providing well-defined interfaces to encourage ecosystem expansion.

🔗 Live Deployments & Status

An example: THINK token on Sepolia Testnet

(Note: These addresses may be from previous development deployments and could be outdated. Always use the latest deployment script for testing.)

Project Status

The core staking and reward systems are feature-complete and ready for audit. The architecture supports two types of reward strategies, POOL_SIZE_INDEPENDENT (e.g., APR-based) and POOL_SIZE_DEPENDENT (e.g., shared reward pools), providing extensive flexibility for future reward programs.

📚 Full Documentation

For a detailed breakdown of all documentation, see the tables below.

For Users

Document Purpose
User Guide Basic staking concepts and step-by-step instructions
Checkpoints Guide How your staking history is tracked for fair rewards
Rewards Guide Complete rewards system explanation

For Developers & Auditors

Document Purpose
Architecture Overview System design and architecture overview
Contract Specifications Detailed technical specifications
Audit Dossier All security-related documentation

🛠️ Technology Stack

  • Smart Contracts: Solidity ^0.8.20
  • Testing Framework: Foundry
  • Security Libraries: OpenZeppelin

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


Need help? Start with the User Guide or Architecture Overview depending on your needs.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors