Skip to content

CONTRACTS: Implement Token Allowance and Delegation #502

@truthixify

Description

@truthixify

Description
Add allowance mechanism allowing token owners to delegate transfer rights to other addresses with configurable limits and expiration.

Files to Modify

  • contracts/manage_hub/src/allowance.rs - Create allowance module
  • contracts/manage_hub/src/types.rs - Add allowance structures
  • contracts/manage_hub/src/membership_token.rs - Integrate allowance checks
  • contracts/manage_hub/src/lib.rs - Add allowance endpoints

Key Changes Required

  • Allowance Storage - Store allowance mappings per token
  • Approve Function - Allow owners to grant allowances
  • Transfer From - Enable delegated transfers using allowances
  • Expiration - Add time-based allowance expiration
  • Revocation - Allow owners to revoke allowances
  • Query Functions - Add functions to check allowances

Acceptance Criteria

  • Implement approve function to set allowances
  • Add transfer_from function for delegated transfers
  • Store allowance amounts and expiration times
  • Emit Approval events when allowances are set
  • Implement revoke_allowance function
  • Add get_allowance query function
  • Support partial allowance consumption
  • Prevent allowance abuse with proper validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions