WIP: Draft: feat(security): pin InstantWithdrawCw20 wire format to ustr-cmm (#21) #42

Closed
PlasticDigits wants to merge 0 commits from 21-feat-security-c-1-verify-instantwithdrawcw20-wire-format-vs-ustr-cmm-treasury-schema into main
PlasticDigits commented 2026-08-08 04:57:38 +00:00 (Migrated from gitlab.com)

Summary

  • Closes audit C-1 / issue #21: treat pinned PlasticDigits2/ustr-cmm treasury ExecuteMsg::InstantWithdrawCw20 as the schema authority (rev e6c4b7cf33f2f56d21c0e9fb2828efe87f032ded).
  • Add golden vectors + scripts/verify_treasury_wire_schema.sh, window/integration conformance tests (INV-SCHEMA-001), strict stub unknown-field rejection, and real-treasury multitest (registered spender success + unregistered atomic revert).
  • Document pin, SetCw20Spender ordering, and live withdraw probe in docs/DEPLOYMENT.md + skills/window-instant-withdraw-cw20.

Acceptance criteria

  • Automated test fails if window InstantWithdrawCw20 JSON diverges from pinned ustr-cmm treasury schema
  • Stubs reject unknown/renamed fields consistently with real treasury decode (cw_serde / deny_unknown_fields + tests)
  • Integration path runs against real treasury crate (CI-gated equivalent of wasm from the pin), not only the local stub
  • Deployment docs include schema pin rev, SetCw20Spender, live withdraw probe before announce
  • Existing deposit/withdraw unit tests still pass; no intentional swap-math behavior change

Test plan

  • cargo test -p ust1-window --lib
  • cargo test -p ust1-integration-tests --lib
  • scripts/verify_treasury_wire_schema.sh
  • Restest: treasury_schema, real_treasury_*, stub_treasury strictness
  • CI green on this MR
  • (Ops, not in this MR) mainnet live withdraw probe after migrate + SetCw20Spender

Closes #21

Closes #21

## Summary - Closes audit **C-1** / issue #21: treat pinned `PlasticDigits2/ustr-cmm` treasury `ExecuteMsg::InstantWithdrawCw20` as the schema authority (rev `e6c4b7cf33f2f56d21c0e9fb2828efe87f032ded`). - Add golden vectors + `scripts/verify_treasury_wire_schema.sh`, window/integration conformance tests (**INV-SCHEMA-001**), strict stub unknown-field rejection, and real-treasury multitest (registered spender success + unregistered atomic revert). - Document pin, SetCw20Spender ordering, and live withdraw probe in `docs/DEPLOYMENT.md` + `skills/window-instant-withdraw-cw20`. ## Acceptance criteria - [x] Automated test fails if window InstantWithdrawCw20 JSON diverges from pinned ustr-cmm treasury schema - [x] Stubs reject unknown/renamed fields consistently with real treasury decode (`cw_serde` / `deny_unknown_fields` + tests) - [x] Integration path runs against real treasury crate (CI-gated equivalent of wasm from the pin), not only the local stub - [x] Deployment docs include schema pin rev, SetCw20Spender, live withdraw probe before announce - [x] Existing deposit/withdraw unit tests still pass; no intentional swap-math behavior change ## Test plan - [x] `cargo test -p ust1-window --lib` - [x] `cargo test -p ust1-integration-tests --lib` - [x] `scripts/verify_treasury_wire_schema.sh` - [x] Restest: `treasury_schema`, `real_treasury_*`, `stub_treasury` strictness - [ ] CI green on this MR - [ ] (Ops, not in this MR) mainnet live withdraw probe after migrate + `SetCw20Spender` Closes #21 Closes #21
PlasticDigits (Migrated from gitlab.com) closed this pull request 2026-08-08 04:57:56 +00:00

Pull request closed

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/ust1-window!42
No description provided.