Skip to content

Enforce BigNumber precision for InteractionPanel inputs #10

Description

@Code-Paragon

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

  • Feature works as described
  • Tests are added or updated where needed
  • Documentation is updated where needed
  • BigNumber validates that the input is > 0 and strictly numeric before allowing handleAction
  • No TypeScript, lint, test, or build errors

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions