Skip to content

[Feature] Design On-Chain Time-Locked Artifact Staking & Energy Recharge Smart Contract Module #26

Description

@Darkvader-ship-it

Estimated Effort: 3 weeks / 9 days

Impacted Subsystems / Files:

  • contracts/phase-protocol/src/lib.rs
  • components/fusion-chamber.tsx
  • lib/phase-protocol.ts

Context & Problem Statement:
Utility NFTs currently store energy_level_bp in PhaseState inside contracts/phase-protocol/src/lib.rs, but energy decays statically without an on-chain mechanism to stake artifacts in the Chamber to boost their energy level or earn yield.

Technical Requirements & Scope:

  1. Implement stake_artifact(token_id, lock_duration_ledgers) and unstake_artifact(token_id) methods in Soroban contract.
  2. Calculate energy level recharge dynamically based on locked duration.
  3. Prevent transfers of staked artifacts while locked.
  4. Update FusionChamber component in components/fusion-chamber.tsx with staking UI visualizers.

Multi-File Change Surface:
Modifies Rust contract contracts/phase-protocol/src/lib.rs, adds client transaction builders, and updates Chamber state management in components/fusion-chamber.tsx.

Acceptance Criteria:

  • Staked NFTs are non-transferable until unlock ledger height.
  • Artifact energy level increases linearly with lock duration up to 10,000 BP.

Suggested Approach / Investigation Steps:

  1. Add StakedArtifact storage struct and implementation methods in Rust.
  2. Write contract unit tests covering unauthorized early unstake attempts.
  3. Build UI controls in Chamber terminal for setting lock duration.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions