Problem
The InteractionPanel.tsx takes the raw string from the native <input> and passes it directly to deposit(amount). This risks severe floating-point errors if not sanitized into a BigNumber prior to transaction execution.
Expected behavior
The input string is passed through bignumber.js to assert validity and strictly format it to 7 decimal places before passing it to the hook, adhering to the CONTRIBUTING.md guidelines.
Files to update
src/components/InteractionPanel.tsx
src/utils/formatting.ts
Project relevance
Protects users from silent precision truncation or NaN transaction failures by catching malformed math strings at the UI layer.
Acceptance criteria
Problem
The
InteractionPanel.tsxtakes the raw string from the native<input>and passes it directly todeposit(amount). This risks severe floating-point errors if not sanitized into aBigNumberprior to transaction execution.Expected behavior
The input string is passed through
bignumber.jsto assert validity and strictly format it to 7 decimal places before passing it to the hook, adhering to theCONTRIBUTING.mdguidelines.Files to update
src/components/InteractionPanel.tsxsrc/utils/formatting.tsProject relevance
Protects users from silent precision truncation or NaN transaction failures by catching malformed math strings at the UI layer.
Acceptance criteria
BigNumbervalidates that the input is > 0 and strictly numeric before allowinghandleAction