Skip to content

[CT-01] Scaffold resource_credits contract — define types and storage keys #765

@yusuftomilola

Description

@yusuftomilola

Overview

Create the initial scaffolding for the resource_credits Soroban contract inside contracts/sandbox/resource_credits/. This includes the project structure, core data types, storage key enum, and error definitions — following the same conventions as the existing workspace_booking and payment_escrow contracts.

Acceptance Criteria

  • contracts/sandbox/resource_credits/Cargo.toml is created with correct Soroban SDK dependency
  • src/lib.rs is created with #![no_std], contract struct, and empty #[contractimpl] block
  • src/types.rs defines CreditBalance, CreditTransaction, and TransactionType structs/enums
  • src/errors.rs defines an Error enum with at least: AdminNotSet, AlreadyInitialized, Unauthorized, InsufficientBalance, InvalidAmount, AccountNotFound
  • DataKey enum in lib.rs covers: Admin, PaymentToken, Balance(Address), TotalSupply, TransactionHistory(Address)
  • initialize(env, admin, payment_token) function is stubbed out
  • Code compiles with cargo build

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions