Conversation
… base units
Owner ruling, 2026-10-01: an amount is entered and shown in whole tokens
with the token's decimals after a point, e.g. `10000.00` for a
two-decimal token, never as base units with the zeros typed by hand.
- `parse_token_units(text, decimals) -> u128`:
- whole tokens, plus up to `decimals` fraction digits;
- a bare integer is whole tokens;
- refused: empty input, any character that is not a digit or the
point, a second point, more fraction digits than the token has, and
overflow.
- `format_token_units(base, decimals)` always shows every decimal place,
and round-trips through the parser.
Every route and screen that takes or shows an amount goes through these,
with the decimals from the token's committed policy.
dsm_sdk's wallet_routes already owns the conversion between typed amounts and base units: parse_display_amount_to_base_units and format_base_units_for_display. It does exact string arithmetic against the token's decimals, and it already serves sends, balances, history and offline cash. 2d529fe added a second copy in Core, and two owners of one rule is what that module's comment forbids. The SoFi routes' amount fields go through the SDK's functions instead.
…ts time out
Owner ruling, 2026-10-01, from the phone-rig run: ERA is divisible to
hundredths.
- **Spec.** SoFi Amendment S18; MR-SOFI-0335 rewritten; MR-SOFI-0349
added (Partial until the SoFi routes take amounts in token units).
MASTER §1 re-pinned.
- **ERA's policy.** It carries decimals 2, and its supply in base units
(8,000,000,000,000, which is 80,000,000,000.00 ERA). Its commitment is
NNG176RZ6ACTWCDPRNYHXZK2DCZ72SPA9Q6XWGRGQ9JGKZYTESG0, a clean cut from
JXPMPGJH…. Nothing under the old commitment carries over.
- **The faucet** pays 10,000 base units (100.00 ERA), and the token
creation fee is 1,000 (10.00 ERA). The amounts people know are
unchanged.
- **Test fixtures.**
- The two-device fixture funds in whole ERA, one faucet claim per
payout.
- The reserve tests and the current-state test use the payout
constant instead of a literal.
- **The storage-member HTTP client** connects within 10 s and finishes a
request within 30 s. On the rig, a position write sat with no request
answered and no error. A member that never answers is now a member
that did not answer.
The dependent sweep for SoFi Amendment S18. Funding is in whole ERA through `economic_fixtures::whole_era`, which scales by ERA's committed decimals. A test that speaks in ERA therefore keeps its meaning. Sends, burns, trades and vault reserves stay in base units, as written. Comments that called a base-unit amount "10 ERA" now say so. - Balances that come from the faucet or the creation fee are stated as `whole_era(n) ± base units`. Covers the faucet, sender admission, bilateral finality, offline step, node e2e and frontier verification tests, plus the restart and projection-repair tests. - Display expectations are at two decimals: history "1.00" and "100.00"; the inbox preview "0.10 ERA"; the pending step "0.03"; the transaction render "-1.00"; the balance row and the frontend ERA fixture "264.00" / "80000000000.00". - ERA's reported facts: decimals 2, and the anchor is the new commitment NNG176RZ6ACTWCDPRNYHXZK2DCZ72SPA9Q6XWGRGQ9JGKZYTESG0. - The offline load is entered as "20.00", which is 2,000 base units. The 41 SDK tests the ERA change turned red now pass: 126 passed / 0 failed across their modules, release.
…-and-token-unit-amounts
cryptskii
added a commit
that referenced
this pull request
Oct 1, 2026
…e SoFi PR One PR for the three branches: the SoFi rig fixes, STORAGE's mirror liveness and route-chain records (#1088), and CORE's ERA with two decimals (#1087). - MASTER: CORE's MR-SOFI-0349 beside MR-SOFI-0350–0359; §1 re-pinned to the merged SoFi specification (S16, S19 and S18); 928 canonical requirements. - CONFORMANCE: MR-SOFI-0349 is Met. The SoFi routes take amounts as text in token units and report their display form, which was the part S18 left Partial. Totals regenerated. - node tests: CORE's whole_era arithmetic, and the new SoFi tests' ERA balances moved to whole_era.
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owner ruling, 2026-10-01, from the phone-rig SoFi run: ERA is divisible to hundredths. The fee model is unchanged: the fee comes out of the input and the trader pays it.
What changes
Spec and records
ERA's policy
NNG176RZ6ACTWCDPRNYHXZK2DCZ72SPA9Q6XWGRGQ9JGKZYTESG0, a clean cut fromJXPMPGJH….native_reserve::era_reserve_id). The new ERA therefore has its own reserve chain from genesis. The fleet's old releases are under other cell keys, nothing mixes, and the nodes need no wipe.Amounts people know are unchanged
Token units
parse_display_amount_to_base_unitsandformat_base_units_for_displayare the one conversion. The core duplicate I added first is removed in this branch.Storage-member HTTP client
Tests
economic_fixtures::whole_era(n), which scales by ERA's committed decimals.Board (release, local)
dsmlib 1370/0, plus all 21dsmintegration binaries passing.dsm_sdklib 1040/0 (2 ignored), plus all 11dsm_sdkintegration binaries passing.make lintexit 0.AccountsScreen.tokens24/0.After merge
era_policyand the reserve constants changed bytes.decimals: 0(practice mode and several jest mocks). They are queued for the frontend sweep; this PR doesn't change them.