Module 15 · In Studio · challenge 2 of 2 in this lesson

Track C: build the exchange ledger

A test in Studio grades it and prints a pass code.

Open

Level 3, Professional

Challenge

Check out track/c-exchange, write challenges/work/exchange_ledger.luau until the red team prints ok for every vector, then paste it into src/shared/ExchangeLedger.luau. TRACK_C.md on the branch has a two-player Studio test against real DataStores, which needs a published place with API access. Solution: challenges/solutions/track-c-redteam.md.

Start from
track/c-exchange
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("track-c-redteam") in the server command bar. Copy the pass code from Output.

Done means

  • ExchangeLedger.new(store, mailbox, opts?) returns a ledger with list, claim and settle that never throw and use "unavailable" only when the store cannot be reached
  • All eight vectors pass: disconnect_mid_commit, cross_server_steal, double_confirm, bad_numbers, offer_swap, receipt_replay, overflow and restricted_region, with no item or coin duplicated or lost and every accepted listing still sellable
  • The finished file is pasted into src/shared/ExchangeLedger.luau on the branch, and ExchangeService starts (no '[Exchange] ExchangeLedger is still the stub' line)

The Course Runner prints this code when the test passes.