Bug: TransferForm crashes on large amounts — BigInt cannot convert scientific notation #95
Labels
No labels
agent:implement
agent:ready
backend
bug
cannot-reproduce
confirmed
desktop
docs
documentation
duplicate
enhancement
feature
frontend
good first issue
help wanted
high-risk
in-review
invalid
mobile
needs-triage
P0-critical
P1-high
P2-medium
P3-low
qa
QA
question
ready
report
responsive
security
security-escalate
smart-contract
solana
tablet
test-pass
ux
wallet-issue
wallet:keplr
wallet:metamask
wallet:station
wallet:walletconnect
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-bridge-monorepo#95
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
entering 1000 TKNA on Anvil->Solana crashes the entire TransferForm component. the scaled amount becomes 1e+21 (scientific notation) which BigInt() cannot parse.
error: Uncaught SyntaxError: Cannot convert 1e+21 to a BigInt (at TransferForm.tsx:781:20)
the UI goes blank (only background visible). no error boundary catches it.
fix: use a BigInt-safe conversion that handles scientific notation, e.g. BigInt(Math.round(Number(value))) or a string-based approach that avoids Number coercion to scientific notation.
commit
003bf31, laptop Vite workflow.mentioned in issue #90
mentioned in issue #96
mentioned in commit
e9d9a2e1b0mentioned in commit
02fac941c3still reproducing on
02d8e6a. tested Anvil->Solana with TKNA (2.985, max amount).TransferForm.tsx:781 crashes with: Cannot convert 4.999005e+23 to a BigInt
the new bigintAmount.ts and scientificDecimal.ts utils were added in this build but TransferForm.tsx:781 is still calling raw BigInt() on a number in scientific notation. the util needs to be wired into TransferForm where the conversion happens.
note: this triggers even on small amounts (2.985 TKNA) because the underlying wei value (2985000000000000000 * fee math) produces scientific notation in JS before the BigInt() call.
mentioned in commit
df7e0664e3Pushed fix in
df7e066onfeat/solana-integration: receive amount now uses bigint fee math (same as Solana record path) instead ofparseFloatscaling, andparseAmountAsBigIntdelegates tobigintFromBaseUnitsStringfor the final conversion. Please re-test Anvil→Solana with TKNA / max. Issue stays open until you confirm.verified on
84c8df3. large amount transfers work without the BigInt scientific notation crash. the bigint fee math fix resolved it. closing.