fix: snapshot factory discount registry into new pairs (#536) #1065
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic!1065
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/536-factory-discount-registry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #536. Persist a canonical
discount_registryon factoryConfigand copy it into new pairs atCreatePairso listings after the last governance sweep are not unwired.Config.discount_registry: Option<Addr>with#[serde(default)]so columbus-5 state migrates asNone.SetDiscountRegistryAll/SetDiscountRegistryBatchwithSome/Nonealso write/clear the factory pointer. Single-pairSetDiscountRegistrydoes not change the pointer.UpdateConfig { discount_registry }sets the pointer without touching indexed pairs.CreatePaircopiesconfig.discount_registryintoPairInstantiateMsg.msg.discount_registry(optional, defaultNone).GetDiscountRegistry(was documented, missing fromQueryMsg).set_discount_registry_allbefore firstCreatePair; per-pairset_discount_registrystays as belt-and-suspenders.skills/AGENTS_FACTORY_DISCOUNT_REGISTRY.md,make verify-issue-536.Existing live pairs stay unwired — that remains #535.
Post-merge follow-ups (do not close with this MR): #538.
Test plan
make test-contracts(includes 7 inherit tests indiscount_registry_inherit_tests.rs)make verify-issue-536(5/5 including retest)python3 scripts/check_fee_discount_tier_docs.pySetDiscountRegistry— #538Issue criteria
Config.discount_registry+ serde defaultNoneUpdateConfig { discount_registry }without touching pairsCreatePaircopies factory pointer into instantiate msgmsg.discount_registry(defaultNone)GetDiscountRegistryqueryNone; missing Config field →None; single-pair Set does not change pointer; GetDiscountRegistrymake test-contractsFrontend only adds
FactoryConfigResponse.discount_registry?andgetPairDiscountRegistry(). Swap/Pool still assume a wired pair; consuming that helper is #538.Closes #536
Related to #538
marked this merge request as ready
mentioned in issue #538
changed the description
Post-merge follow-up is #538 (factory pointer after migrate, LocalTerra inherit check, optional dApp
GetDiscountRegistry). That issue must stay open when this MR merges — it is related, not closed by !1065.mentioned in commit
651cb642a7mentioned in issue #536