Skip to content

CONTRACTS: Implement Token Renewal System #421

@truthixify

Description

@truthixify

Description

Add functionality to renew membership tokens before they expire, including automatic renewal options and grace periods for expired tokens.

Files to Modify

  • contracts/manage_hub/src/membership_token.rs - Add renewal functions
  • contracts/manage_hub/src/lib.rs - Add renewal endpoints
  • contracts/manage_hub/src/types.rs - Add renewal data structures
  • contracts/manage_hub/src/errors.rs - Add renewal-specific errors
  • contracts/common_types/src/types.rs - Add renewal status enum

Key Changes Required

  1. Renewal Data Structures - Add renewal tracking structures to types.rs and common_types/src/types.rs
  2. Token Renewal Logic - Implement renewal functions in membership_token.rs with grace period handling
  3. Renewal Configuration - Add configurable renewal settings (grace periods, fees, limits) with admin management
  4. Payment Integration - Integrate renewal fees with the existing payment system in the subscription module
  5. Renewal History - Track all renewal attempts and history for each token with proper storage management
  6. Auto-Renewal System - Implement automatic renewal checking and processing capabilities
  7. Renewal Validation - Add comprehensive validation for renewal eligibility and limits

Acceptance Criteria

  • Add renew_token function to membership contract
  • Implement grace period for expired tokens (configurable, default 7 days)
  • Add automatic renewal configuration and checking
  • Include payment validation for renewals with configurable fees
  • Add renewal history tracking with renewal count limits
  • Update tests for renewal scenarios including edge cases
  • Add renewal eligibility checking functions
  • Implement renewal notification events

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions