fix: prove CreatePair inherit and prefer GetDiscountRegistry (#538) #1075

Merged
PlasticDigits merged 1 commit from feat/538-create-pair-inherit into main 2026-08-17 10:29:23 +00:00
PlasticDigits commented 2026-08-17 10:19:48 +00:00 (Migrated from gitlab.com)

Summary

Closes #538. Post-#536 follow-ups: dedicated LocalTerra create_pair inherit (no follow-up SetDiscountRegistry) and dApp GetDiscountRegistry smart-query-first.

  • F538-2: scripts/qa/localterra-create-pair-inherit.sh instantiates throwaway CW20s, create_pair, and asserts pair GetDiscountRegistry matches factory config.discount_registry without executing SetDiscountRegistry.
  • deploy-dex-local.sh asserts inherit before the existing idempotent per-pair set (belt-and-suspenders stays).
  • F538-3: getPairDiscountRegistry prefers GetDiscountRegistry; LCD raw discount_registry is fallback for 1.13.x wasm. settings.ts re-exports the same helper.
  • F538-1: Columbus-5 factory pointer is already set (ops note); LocalTerra verify also requires a non-null factory pointer. I10 fail-closed fee behavior is unchanged.

Invariants F538-1–F538-3 / I14 / F5. Playbooks: skills/AGENTS_FACTORY_DISCOUNT_REGISTRY.md, skills/AGENTS_FRONTEND_PAIR_FEE_DISCOUNT.md. Regression: make verify-issue-538.

Test plan

  • make verify-issue-538 (7/7 including retest; live LocalTerra inherit)
  • make verify-issue-537 (7/7 regression)
  • python3 scripts/check_fee_discount_tier_docs.py
  • Manual Swap/Pool fee chrome on a wired LocalTerra pair still strikethroughs when registered
  • Manual: 1.13.x pair (if any remain) still fail-closed via raw fallback

Issue criteria

Criterion Status
Factory config.discount_registry is the fee-discount contract after migrate + All/Batch or UpdateConfig Done on columbus-5 (ops; documented F538-1). LocalTerra verify requires the pointer. This MR does not re-run mainnet All/Batch.
New LocalTerra pair GetDiscountRegistry matches factory pointer without a follow-up set Done — dedicated inherit script + deploy assert before Set
(Optional) Swap/Pool use pair GetDiscountRegistry instead of assuming wired Done — chrome already gated in #537; probe is now smart-query-first (F538-3)

Not in this MR

  • Wiring already-listed economic pairs (#535)
  • Changing I10 fail-closed fee behavior
  • Removing deploy-dex-local per-pair set_discount_registry (kept as idempotent after inherit assert)

Closes #538
Related to #536 #537

## Summary Closes [#538](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/538). Post-#536 follow-ups: dedicated LocalTerra `create_pair` inherit (no follow-up `SetDiscountRegistry`) and dApp `GetDiscountRegistry` smart-query-first. - **F538-2:** [`scripts/qa/localterra-create-pair-inherit.sh`](scripts/qa/localterra-create-pair-inherit.sh) instantiates throwaway CW20s, `create_pair`, and asserts pair `GetDiscountRegistry` matches factory `config.discount_registry` without executing `SetDiscountRegistry`. - `deploy-dex-local.sh` asserts inherit **before** the existing idempotent per-pair set (belt-and-suspenders stays). - **F538-3:** `getPairDiscountRegistry` prefers `GetDiscountRegistry`; LCD raw `discount_registry` is fallback for 1.13.x wasm. `settings.ts` re-exports the same helper. - **F538-1:** Columbus-5 factory pointer is already set (ops note); LocalTerra verify also requires a non-null factory pointer. I10 fail-closed fee behavior is unchanged. Invariants **F538-1–F538-3** / **I14** / **F5**. Playbooks: `skills/AGENTS_FACTORY_DISCOUNT_REGISTRY.md`, `skills/AGENTS_FRONTEND_PAIR_FEE_DISCOUNT.md`. Regression: `make verify-issue-538`. ## Test plan - [x] `make verify-issue-538` (7/7 including retest; live LocalTerra inherit) - [x] `make verify-issue-537` (7/7 regression) - [x] `python3 scripts/check_fee_discount_tier_docs.py` - [ ] Manual Swap/Pool fee chrome on a wired LocalTerra pair still strikethroughs when registered - [ ] Manual: 1.13.x pair (if any remain) still fail-closed via raw fallback ## Issue criteria | Criterion | Status | |-----------|--------| | Factory `config.discount_registry` is the fee-discount contract after migrate + All/Batch or `UpdateConfig` | Done on columbus-5 (ops; documented **F538-1**). LocalTerra verify requires the pointer. This MR does not re-run mainnet All/Batch. | | New LocalTerra pair `GetDiscountRegistry` matches factory pointer without a follow-up set | Done — dedicated inherit script + deploy assert before Set | | (Optional) Swap/Pool use pair `GetDiscountRegistry` instead of assuming wired | Done — chrome already gated in #537; probe is now smart-query-first (**F538-3**) | ## Not in this MR - Wiring already-listed economic pairs ([#535](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/535)) - Changing I10 fail-closed fee behavior - Removing deploy-dex-local per-pair `set_discount_registry` (kept as idempotent after inherit assert) Closes #538 Related to #536 #537
PlasticDigits commented 2026-08-17 10:29:17 +00:00 (Migrated from gitlab.com)

mentioned in issue #538

mentioned in issue #538
PlasticDigits commented 2026-08-17 10:29:18 +00:00 (Migrated from gitlab.com)

mentioned in issue #539

mentioned in issue #539
PlasticDigits commented 2026-08-17 10:29:24 +00:00 (Migrated from gitlab.com)

mentioned in commit 1c6023f294

mentioned in commit 1c6023f2949e10a6155b1dd719557dd9d008609c
PlasticDigits (Migrated from gitlab.com) merged commit 1c6023f294 into main 2026-08-17 10:29:24 +00:00
PlasticDigits commented 2026-08-17 10:31:10 +00:00 (Migrated from gitlab.com)

mentioned in commit 9e3f8e16a7

mentioned in commit 9e3f8e16a701e4a3625344dc8b68011b99888ecb
PlasticDigits commented 2026-08-17 10:32:47 +00:00 (Migrated from gitlab.com)

mentioned in issue #549

mentioned in issue #549
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!1075
No description provided.