Skip to content

Add VersionRegistry capability-flag bitmap to versioning.rs #663

Description

@greatest0fallt1me

Description

Clients currently query version() and have to map each version to known capabilities by hand. Add a capabilities(): u64 bitmap that names features (BatchClaim, TWAPOracle, SlashableMisbehavior, etc.) so clients can probe what is available without a version lookup table.

Requirements and Context

  • Define Capability constants in versioning.rs
  • Emit CapabilitiesUpdated event on upgrade
  • Cover with a test that asserts every shipped feature flips its bit
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b feature/version-capability-bitmap
  2. Implement changes
    • contracts/predictify-hybrid/src/versioning.rs
    • contracts/predictify-hybrid/src/tests/capability_bitmap_tests.rs
  3. Test and commit
    • cargo test -p predictify-hybrid capability_bitmap
    • Cover edge cases
    • Include test output and notes in the PR

Example commit message

feat: expose capability bitmap via versioning::capabilities()

Acceptance Criteria

  • Bitmap exposed via a new public view entrypoint
  • At least four capability bits are defined and tested
  • Event emitted whenever bitmap changes

Guidelines

  • Clear documentation and inline comments
  • Real Soroban SDK idioms in any new helper code
  • Timeframe: 96 hours

Metadata

Metadata

Labels

GRANTFOX OSSGrantFox open-source campaign taskOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveIssues in the Stellar wave programenhancementNew feature or improvementrustRust implementationsmart-contractSoroban smart-contract worksorobanSoroban SDK / Stellar

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions