Skip to content

Avoid float parsing in disperse validation#28

Open
samsamtrum wants to merge 1 commit into
0xgasless:mainfrom
samsamtrum:fix-disperse-amount-validation
Open

Avoid float parsing in disperse validation#28
samsamtrum wants to merge 1 commit into
0xgasless:mainfrom
samsamtrum:fix-disperse-amount-validation

Conversation

@samsamtrum
Copy link
Copy Markdown

Fixes two edge cases in the disperse action amount/address validation:

  • validates recipient addresses with viem isAddress, matching the rest of the EVM tooling more closely than a manual regex
  • removes parseFloat from amount validation and summary calculation so values like 1abc are not accepted as 1, and large/precise decimal strings are not rounded in the displayed total

The transfer encoding path already uses parseEther/parseUnits; this makes the pre-validation and summary follow the same decimal parser.

@Adi-21
Copy link
Copy Markdown
Contributor

Adi-21 commented May 31, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants