AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 64 Monero

Improve decimal handling

Public commit record

What the developer wrote

Authored by Justin Ehrenhofer

28/100 · Opaque
Improve decimal handling
✓ Subject identifies a change! No meaningful explanatory body
The short version

What changed, and why it matters

This commit fixes a Monero wallet bug where the amount a user wanted to send could silently change because the app was converting the typed amount into a 'double' (a computer number format with limited precision) before turning it into the exact atomic units the blockchain actually uses. The patch keeps the amount as text the whole way through, so the value the user sees is the value that gets spent. It also fixes a related bug where tapping 'Max' for large balances could produce unusable scientific notation like '5e-7'.

Recommended action

Review the domain.decimalToBaseUnits and baseUnitsToDecimalString helpers for correct handling of edge cases (empty input, leading/trailing decimals, locale separators, overflow). Add regression tests covering very small amounts, amounts near 9007 XMR, scientific notation, and the 'Max' button path. Verify that no other screens or adapters still pass spend amounts through double.

Security signals we found

01

Precision loss in financial amount conversion (double -> base units)

02

Silent amount truncation in transaction creation

03

Potential incorrect fee estimation due to amount rounding

04

Scientific-notation crash/parse failure on 'Max' balance for small or large balances

05

Fix keeps spend amounts as exact decimal text end-to-end

Risk score

Why this scored 64/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 10/15
Affected reach 12/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.