chore(treasury): remove obsolete SwapDeposit / swap_contract (bundle with #5 migrate) #8
Labels
No labels
bug
docs
documentation
duplicate
enhancement
frontend
good first issue
help wanted
invalid
missing-implementation
priority
medium
product
QA
question
testing
UX
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/ustr-cmm#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
Remove the broken/legacy treasury ↔ swap integration during the #5 Phase 3 treasury migrate.
Treasury
SwapDepositstill emitsNotifyDeposit { depositor, amount }via a privateSwapExecuteMsg, but liveustc-swaphas no such message (onlySwap { referral_code, leaderboard_hint }). The path is dead code / a footgun: if called withswap_contractset to ustc-swap, the submessage fails and the tx reverts atomically (no silent fund loss).Audit: MB-1 in
audits/INTERNAL_COMPOSER_1785465508.md.Chosen remediation: option (1) — full removal (not hard-disable, not restoring
NotifyDepositon ustc-swap). Current product path is User →ustc-swap::Swap→ forward USTC to Treasury + mint USTR. Frontend never callsSwapDeposit. Issue #5 already requires swap remain disabled (swap_contractnull).Bundle into the same treasury wasm store + in-place migrate as #5 so mainnet drops the obsolete ABI in one upgrade.
Scope (remove from treasury)
ExecuteMsg::SwapDeposit {}ExecuteMsg::SetSwapContract { contract_addr }Config.swap_contract: Option<Addr>SwapExecuteMsg::NotifyDepositSwapContractNotSet, swap-fund validation if only used heredocs/ARCHITECTURE.mdstill diagrams the old tax-freeNotifyDepositflow — update to currentSwaparchitecture; alignCONTRACTS.md/PROPOSAL.md/ wrap plans that reference SwapDeposit as a patternDo not remove wrap-mapper
NotifyDeposit/ treasuryWrapDeposit— that path is live and unrelated.Do not change
ustc-swapproduct ABI beyond any incidental doc cleanup.Why bundle with #5
denom_wrappers, etc.) and explicitly says: do not re-enable USTC→USTR /SwapDeposit; leaveswap_contractnull.swap_contract: null; removal matches ops reality.Implementation notes
migratesucceeds from current mainnet layout (code 10673 → new) and from intermediate wrap-capable code if already on a branch with wrap fields. Decide whether to:swap_contractfromConfigwith carefulcw_serde/ custom migrate load, orswap_contract.SwapDepositpost-migrate (plans/NATIVE_TOKEN_WRAPPING.mdA13).Acceptance criteria
SwapDeposit/SetSwapContract/swap_contractremoved from treasury ExecuteMsg, Config, state, and handlers.SwapExecuteMsg/ NotifyDeposit-to-swap path removed.NotifyDepositto ustc-swap.ARCHITECTURE.mdat minimum;CONTRACTS.md/ related plans).Test plan
cargo testin treasury (and workspace contracts) after removal.swap_contract(Some/None) → new config without field.WrapDeposit→ wrap-mapperNotifyDepositunchanged.Related
audits/INTERNAL_COMPOSER_1785465508.md)docs/CONTRACTS.md,plans/PROPOSAL.mdmarked as related to #5
mentioned in issue #5
mentioned in commit
b2fe58e020mentioned in merge request !29
mentioned in merge request !30
mentioned in commit
5ecee9d082mentioned in commit
c49e3cd932