8000 GitHub - crossfichain/native-staking-contracts
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

crossfichain/native-staking-contracts

Repository files navigation

Native Staking Contracts

Smart contracts for staking native XFI tokens to CrossFi validators with Oracle integration for MPX conversion.

Overview

The Native Staking system allows users to stake their native XFI tokens to validators in the CrossFi network. The system includes:

  • Two-step unstaking - Initiated by users, completed by operators
  • Reward claiming - Two-step process with backend integration
  • Validator management - Add, update status, and migrate between validators
  • Emergency withdrawal - Safety feature for urgent situations
  • Oracle integration - XFI/MPX price conversion

Architecture

System Architecture

The system consists of three main components:

  • Core contracts: NativeStaking for staking operations
  • Periphery contracts: UnifiedOracle for price feeds
  • Libraries: Utilities for validation and price conversion

Documentation

Detailed documentation is available in the /docs directory:

Development

Prerequisites

Setup

  1. Clone the repository
  2. Copy .env.example to .env and configure your environment
  3. Install dependencies:
forge install

Testing

forge test

Deployment

For development deployment:

forge script script/DeployNativeStakingDev.s.sol:DeployNativeStakingDev --broadcast --rpc-url $RPC_URL -vvv

For production deployment, see the Deployment Guide.

Security

This code is pending audit and is not recommended for production use until a thorough security review has been completed.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0