bug: No balance validation — swap submits amounts exceeding wallet balance #9

Closed
opened 2026-03-12 04:49:52 +00:00 by Brouie · 8 comments
Brouie commented 2026-03-12 04:49:52 +00:00 (Migrated from gitlab.com)

Description

Swap allows submitting amounts larger than wallet balance. TX fails on-chain with overflow error instead of being caught client-side.

Error

Overflow: Cannot Sub with 895770474897 and 1009976018432: execute wasm contract failed

Expected

Frontend should check wallet token balance and disable swap button or show error when amount exceeds balance.

Steps to Reproduce

  1. Connect wallet
  2. Select any pair
  3. Enter amount larger than token balance
  4. Click Swap
  5. TX submits and fails on-chain

Impact

Bad UX — user wastes gas on a guaranteed-to-fail transaction.

## Description Swap allows submitting amounts larger than wallet balance. TX fails on-chain with overflow error instead of being caught client-side. ## Error `Overflow: Cannot Sub with 895770474897 and 1009976018432: execute wasm contract failed` ## Expected Frontend should check wallet token balance and disable swap button or show error when amount exceeds balance. ## Steps to Reproduce 1. Connect wallet 2. Select any pair 3. Enter amount larger than token balance 4. Click Swap 5. TX submits and fails on-chain ## Impact Bad UX — user wastes gas on a guaranteed-to-fail transaction.
PlasticDigits commented 2026-03-12 07:04:51 +00:00 (Migrated from gitlab.com)

Fix implemented in commit 711f692: the frontend now queries the offer token balance and disables the Swap button with an "Insufficient Balance" message when the entered amount exceeds the wallet balance. Balance is displayed with a Max button. @Brouie please verify when you have a moment.

Fix implemented in commit 711f692: the frontend now queries the offer token balance and disables the Swap button with an "Insufficient Balance" message when the entered amount exceeds the wallet balance. Balance is displayed with a Max button. @Brouie please verify when you have a moment.
PlasticDigits commented 2026-03-12 11:49:15 +00:00 (Migrated from gitlab.com)

mentioned in commit 711f692c74

mentioned in commit 711f692c741958b9476f7255b6b38c2fc83db766
Brouie (Migrated from gitlab.com) closed this issue 2026-03-13 01:57:15 +00:00
Brouie commented 2026-03-13 01:57:16 +00:00 (Migrated from gitlab.com)

Verified fixed — swap page now shows INSUFFICIENT BALANCE when amount exceeds wallet balance.

Verified fixed — swap page now shows INSUFFICIENT BALANCE when amount exceeds wallet balance.
Brouie commented 2026-03-13 02:02:25 +00:00 (Migrated from gitlab.com)

mentioned in issue #1

mentioned in issue #1
Brouie commented 2026-03-13 04:22:44 +00:00 (Migrated from gitlab.com)

mentioned in issue #18

mentioned in issue #18
PlasticDigits commented 2026-05-29 05:40:52 +00:00 (Migrated from gitlab.com)

mentioned in issue #225

mentioned in issue #225
PlasticDigits commented 2026-06-05 12:41:48 +00:00 (Migrated from gitlab.com)

mentioned in merge request !803

mentioned in merge request !803
PlasticDigits commented 2026-08-15 09:57:17 +00:00 (Migrated from gitlab.com)

mentioned in issue #516

mentioned in issue #516
Sign in to join this conversation.
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#9
No description provided.