Avoid float parsing in disperse validation#28
Open
samsamtrum wants to merge 1 commit into
Open
Conversation
Contributor
|
Hey Kaly,
Would review your PR , thanks for your contribution.
Regards,
Aditya Singh
Devrel 0xGasless
…On Sun, May 31, 2026 at 3:28 PM Kaly Node ***@***.***> wrote:
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.
------------------------------
You can view, comment on, or merge this pull request online at:
#28
Commit Summary
- 6e96495
<6e96495>
Avoid float parsing in disperse validation
File Changes
(1 file <https://github.com/0xgasless/agentkit/pull/28/files>)
- *M* agentkit-core/src/actions/disperseAction.ts
<https://github.com/0xgasless/agentkit/pull/28/files#diff-964a99b4a0be73db56d571aebcfac83697d1add7141b685cfb90591d407e3c90>
(21)
Patch Links:
- https://github.com/0xgasless/agentkit/pull/28.patch
- https://github.com/0xgasless/agentkit/pull/28.diff
—
Reply to this email directly, view it on GitHub
<#28?email_source=notifications&email_token=ASNU3VSH24GWBIZTQMYEXE345P65DA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTONZWGA4DCNRRGKTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASNU3VUVWMHGQIRWJ5GFYST45P65DAVCNFSM6AAAAACZUJWZK6VHI2DSMVQWIX3LMV43ASLTON2WKOZUGU2TOMRQGAZDQMA>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/ASNU3VUG2J736TZ7ND3QNOD45P65DA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTONZWGA4DCNRRGKTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVJTG633UMVZF62LPOM>
and Android
<https://github.com/notifications/mobile/android/ASNU3VWCYSM7D3S3MTF4KY345P65DA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTONZWGA4DCNRRGKTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVZTG633UMVZF6YLOMRZG62LE>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
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.
Fixes two edge cases in the disperse action amount/address validation:
isAddress, matching the rest of the EVM tooling more closely than a manual regexparseFloatfrom amount validation and summary calculation so values like1abcare not accepted as1, and large/precise decimal strings are not rounded in the displayed totalThe transfer encoding path already uses
parseEther/parseUnits; this makes the pre-validation and summary follow the same decimal parser.