Skip to content

Support Multiple Payment Tokens #37

@Bosun-Josh121

Description

@Bosun-Josh121

Target Contract: payment-vault-contract
Labels: phase-1-vault, feature

Description: Currently fixed to one token at init. The platform should support XLM, USDC, and other stablecoins simultaneously.

Tasks:

  • src/storage.rs: Replace single DataKey::Token with DataKey::AllowedToken(Address) -> bool. Add add_allowed_token and remove_allowed_token helpers.
  • src/types.rs: Add token_address: Address to BookingRecord.
  • src/contract.rs: Implement add_payment_token(env, token). Admin auth required. Update book_session to accept payment_token: Address. Verify storage::is_token_allowed(payment_token).
  • src/lib.rs: Expose pub fn add_payment_token(env: Env, token: Address) and update book_session signature in #[contractimpl].
  • src/test.rs: Admin adds USDC. User books with USDC -> Success. User books with unregistered fake token -> Fails.

Acceptance Criteria:

  • Users can book sessions using different whitelisted assets.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    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