mirror of
https://github.com/luxfi/bank.git
synced 2026-10-30 17:02:07 +00:00
Every money bug this session was int64 meeting int64. A debt in cents was subtracted from a balance in an asset's own units and a +$340 vault position rendered as -$5,600; a repayment sized in the collateral's decimals reached a contract counting the synthetic's, off by 1e10. The comments carried the unit — CollateralUsd int64 // USD cents — and comments do not typecheck. Cents and Minor are distinct types. The only crossing is usd(), which needs a price, which is why it should be the only one. The compiler found every place they met, including the control in the Earn guard, which deliberately reproduces the old sum: it no longer compiles, so it now casts by hand and says why. money[T] reads a whole amount off a record and rounds, once, instead of at the thirty call sites that each had to remember — one of which had not. An existing database could not boot. Base refuses to update any collection whose name equals its own id, because checkUniqueName looks up that id and does not exclude the collection being saved. Every collection here is NewBaseCollection(name, name), so each was creatable once and never updatable, and a schema addition failed a running bank at startup. The upgrade path saves without that validation; nothing there changes a name. Reproduced on a database written by the older build and now booting clean on this one. The dash also ships as a library. lux.finance renders it whole; the Lux Cloud console renders the same screens beside a validator's nodes and keys. bankd validates a bearer at IAM's userinfo without checking audience, so the console's Lux ID session already authorizes the bank — no second sign-in, no exchange. The grid compiler runs at library build time, so a host needs no plugin of its own. Colour belonged to the brand tokens but the layout runtime painted body from its own theme, unlayered, so everything that inherited landed on the wrong brand — white text on the light brand's white page, across the whole app. Co-authored-by: Hanzo Dev <[email protected]>