FAILURE MAP
← Case archive

FA-86214 / Game economy crafting balance / Member archive

Currency exchange desk: Same-currency exchange charges a fee · case 04

Converting gold to gold loses money.

Member previewVariant 4 · 3 implementations · 8 checks per implementation

Case contract

rates map currency -> copper value. Same currency returns [amount, 0] without fee. Otherwise value = amount*rate[from]; fee = ceil(value*fee_bp/10000), at least 1 copper when value > 0 and fee_bp > 0 and 0 otherwise; net = value - fee; return [net // rate[to], net % rate[to]] (change in copper).

Why this case matters

Game economies leak or destroy currency when one crafting or pricing rule is off by one boundary, rounding stage or state update; the defect is observable in exact integer outcomes.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
same currency no fee #1[4, 9250][5, 0]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗