Skip to content

Enforce canonical token ordering in pair identifiers #182

@Baskarayelu

Description

@Baskarayelu

Enforce canonical token ordering in pair identifiers

Description

  • Pair keys can be generated in non-canonical order, enabling duplicate market representations.

Requirements and context

  • Standardize key creation with deterministic ordering.
  • Keep lookup compatibility for existing pairs.

Suggested execution

  • Sort token addresses when deriving pair IDs.
  • Migrate or alias legacy keys where necessary.

Test and commit

  • Add tests proving (A,B) and (B,A) resolve identically.
  • Ensure duplicate pair creation is impossible.

Example commit message

  • fix(contracts): canonicalize token ordering in pair keys

Guidelines

  • Avoid expensive sorting beyond two-token pairs.
  • Keep event payload ordering consistent.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcontractsSmart contract workdexintegrityIntegrity checkssoliditySolidity and EVM

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions