Skip to content

feat: clear pair config on unregister#138

Open
webmirroring wants to merge 1 commit into
StableRoute-Org:mainfrom
webmirroring:feature/contracts-clear-orphaned-pair-config
Open

feat: clear pair config on unregister#138
webmirroring wants to merge 1 commit into
StableRoute-Org:mainfrom
webmirroring:feature/contracts-clear-orphaned-pair-config

Conversation

@webmirroring

Copy link
Copy Markdown

Closes #121.

Summary

  • Added a private clear_pair_config helper used by unregister_pair.
  • unregister_pair now removes PairFeeBps, PairMinAmount, PairMaxAmount, and PairLiquidity after removing the pair registration.
  • Preserved the existing unreg event and added a companion cfg_clr event for indexers.
  • Updated tests and docs so re-registering a pair starts from default fee, bounds, and liquidity values.

Security notes

  • Admin gating and idempotency are unchanged.
  • Removing absent config slots remains a no-op.
  • Route counters, cumulative volume, and last-route timestamp are intentionally left untouched because they are operational history, not live config.
  • This prevents stale fee/bounds/liquidity config from silently reviving after unregister + re-register.

Validation

  • cargo fmt -- --check
  • git diff --check
  • Attempted cargo test unregister -- --nocapture and cargo test pair_lifecycle -- --nocapture, but this local machine has Cargo 1.84.0 and fails before compiling because base64ct v1.8.3 requires edition2024 / Cargo 1.85+.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clear orphaned PairFeeBps, PairMinAmount, PairMaxAmount, and PairLiquidity slots on unregister_pair

2 participants