Skip to content

Contract SDK: price and decimal scaling helpers #346

Description

@0xMegie

Area: packages/contracts/src/scaling.ts

Goal: Verify protocol-scale price/amount scaling stays lossless.

Tasks:

  • Add fixtures converting human amounts to/from protocol decimals.
  • Cover 1e30 USD scale and token decimal boundaries.
  • Assert round-trips never downcast through JavaScript number.

Acceptance:

  • Values stay as bigint/string; no precision loss.
  • bun run --cwd packages/contracts test passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions