You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Overview
Create the initial scaffolding for the
resource_creditsSoroban contract insidecontracts/sandbox/resource_credits/. This includes the project structure, core data types, storage key enum, and error definitions — following the same conventions as the existingworkspace_bookingandpayment_escrowcontracts.Acceptance Criteria
contracts/sandbox/resource_credits/Cargo.tomlis created with correct Soroban SDK dependencysrc/lib.rsis created with#![no_std], contract struct, and empty#[contractimpl]blocksrc/types.rsdefinesCreditBalance,CreditTransaction, andTransactionTypestructs/enumssrc/errors.rsdefines anErrorenum with at least:AdminNotSet,AlreadyInitialized,Unauthorized,InsufficientBalance,InvalidAmount,AccountNotFoundDataKeyenum inlib.rscovers:Admin,PaymentToken,Balance(Address),TotalSupply,TransactionHistory(Address)initialize(env, admin, payment_token)function is stubbed outcargo build