feat(frontend): 25/50/75/100% amount fraction presets (#303) #759

Merged
Brouie merged 1 commit from qa/303-fraction-buttons into main 2026-06-05 03:25:39 +00:00
Brouie commented 2026-06-05 03:21:47 +00:00 (Migrated from gitlab.com)

Follow-up on #303. The shared AmountBalanceActions only exposed Max (+ 50% on pool). Added optional fraction-preset buttons (default 25/50/75/100%) — backward-compatible (existing showHalf/onMax callers unchanged) — each applying its fraction to the same gas-adjusted spendable Max uses, via exact bigint math (no float drift). Wired on the swap You Pay field and the trade/limit escrow amount field; pool keeps its own Max + 50%. tsc -b clean. Browser verification is totdking's. No closing keyword.

Follow-up on #303. The shared `AmountBalanceActions` only exposed `Max` (+ `50%` on pool). Added optional fraction-preset buttons (default 25/50/75/100%) — backward-compatible (existing `showHalf`/`onMax` callers unchanged) — each applying its fraction to the same gas-adjusted spendable `Max` uses, via exact bigint math (no float drift). Wired on the swap You Pay field and the trade/limit escrow amount field; pool keeps its own Max + 50%. tsc -b clean. Browser verification is totdking's. No closing keyword.
Brouie commented 2026-06-05 03:23:24 +00:00 (Migrated from gitlab.com)

mentioned in issue #303

mentioned in issue #303
PlasticDigits commented 2026-06-05 03:24:07 +00:00 (Migrated from gitlab.com)

Security review (automated)

Commit reviewed: 842dedc021f92c1018f2cdabbf91b499a9e40676
Scope: Frontend-only — optional 25/50/75/100% fraction presets in AmountBalanceActions, wired on swap “You pay” and limit-order escrow amount (AmountBalanceActions.tsx, SwapPage.tsx, LimitOrderEscrowAmountField.tsx).

Outcome: FINDINGS: 0 medium or higher.

Inline threads: None.

Notes

  • Fraction amounts use the same gas-adjusted spendableRaw as Max, with floor bigint math ((spendableRaw * pct) / 100n) and fromRawAmount — no new attacker-controlled inputs; default presets are fixed constants.
  • onFraction handlers mirror existing Max wiring (setInputAmount / onAmountChange). Clearing showImpactConfirm on fraction click matches manual amount edits and still requires a fresh two-step confirm when price impact remains above the threshold.
  • No backend, contract, dependency, or secret-handling changes in this diff.

Security review: no medium+ findings on this diff.

## Security review (automated) **Commit reviewed:** `842dedc021f92c1018f2cdabbf91b499a9e40676` **Scope:** Frontend-only — optional 25/50/75/100% fraction presets in `AmountBalanceActions`, wired on swap “You pay” and limit-order escrow amount (`AmountBalanceActions.tsx`, `SwapPage.tsx`, `LimitOrderEscrowAmountField.tsx`). **Outcome:** `FINDINGS: 0` medium or higher. **Inline threads:** None. ### Notes - Fraction amounts use the same gas-adjusted `spendableRaw` as Max, with floor bigint math (`(spendableRaw * pct) / 100n`) and `fromRawAmount` — no new attacker-controlled inputs; default presets are fixed constants. - `onFraction` handlers mirror existing Max wiring (`setInputAmount` / `onAmountChange`). Clearing `showImpactConfirm` on fraction click matches manual amount edits and still requires a fresh two-step confirm when price impact remains above the threshold. - No backend, contract, dependency, or secret-handling changes in this diff. **Security review: no medium+ findings on this diff.**
PlasticDigits (Migrated from gitlab.com) merged commit 9f0babe556 into main 2026-06-05 03:25:39 +00:00
PlasticDigits commented 2026-06-05 03:26:13 +00:00 (Migrated from gitlab.com)

mentioned in commit 9f0babe556

mentioned in commit 9f0babe5564aa4345c1546454ed7e6cab1c916f3
PlasticDigits commented 2026-06-05 05:52:34 +00:00 (Migrated from gitlab.com)

mentioned in merge request !770

mentioned in merge request !770
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!759
No description provided.