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

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions