feat(security): pin InstantWithdrawCw20 wire format to ustr-cmm (#21) #43

Merged
PlasticDigits merged 5 commits from fix/issue-21-instant-withdraw-cw20-schema into main 2026-08-08 05:48:27 +00:00
PlasticDigits commented 2026-08-08 04:58:02 +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

## 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
PlasticDigits commented 2026-08-08 04:58:07 +00:00 (Migrated from gitlab.com)

Worktree: fix/issue-21-instant-withdraw-cw20-schema @ 7021c86. Local verification: make test-contracts, scripts/verify_treasury_wire_schema.sh, and restest of treasury_schema / real_treasury_* / stub strictness all green.

Worktree: `fix/issue-21-instant-withdraw-cw20-schema` @ `7021c86`. Local verification: `make test-contracts`, `scripts/verify_treasury_wire_schema.sh`, and restest of `treasury_schema` / `real_treasury_*` / stub strictness all green.
PlasticDigits commented 2026-08-08 05:00:42 +00:00 (Migrated from gitlab.com)

Verification re-run on worktree after push:

  • cargo test -p ust1-window --lib — 20 passed
  • cargo test -p ust1-integration-tests --lib — 19 passed (incl. treasury_schema, real_treasury_*, stub strictness)
  • scripts/verify_treasury_wire_schema.sh — golden matches ustr-cmm @e6c4b7cf…
  • cargo clippy --all-targets -- -D warnings — clean

Schema pin: USTR_CMM_TREASURY_SCHEMA_REV / workspace cmm-treasury = e6c4b7cf33f2f56d21c0e9fb2828efe87f032ded.

Verification re-run on worktree after push: - `cargo test -p ust1-window --lib` — 20 passed - `cargo test -p ust1-integration-tests --lib` — 19 passed (incl. `treasury_schema`, `real_treasury_*`, stub strictness) - `scripts/verify_treasury_wire_schema.sh` — golden matches ustr-cmm `@e6c4b7cf…` - `cargo clippy --all-targets -- -D warnings` — clean Schema pin: `USTR_CMM_TREASURY_SCHEMA_REV` / workspace `cmm-treasury` = `e6c4b7cf33f2f56d21c0e9fb2828efe87f032ded`.
PlasticDigits commented 2026-08-08 05:10:50 +00:00 (Migrated from gitlab.com)

mentioned in issue #25

mentioned in issue #25
PlasticDigits commented 2026-08-08 05:10:51 +00:00 (Migrated from gitlab.com)

mentioned in issue #21

mentioned in issue #21
PlasticDigits commented 2026-08-08 05:10:59 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 97248605 - ci: bump GitLab rust image to 1.88 for Cargo.lock MSRV

Compare with previous version

added 1 commit <ul><li>97248605 - ci: bump GitLab rust image to 1.88 for Cargo.lock MSRV</li></ul> [Compare with previous version](/PlasticDigits/ust1-window/-/merge_requests/10/diffs?diff_id=1950015694&start_sha=7021c8661d568f3c0f3c717af5f5219c09257484)
PlasticDigits commented 2026-08-08 05:16:05 +00:00 (Migrated from gitlab.com)

added 6 commits

  • 97248605...deb4453d - 4 commits from branch main
  • d8fa2081 - feat(security): pin InstantWithdrawCw20 wire format to ustr-cmm (#21)
  • 875b7aed - ci: bump GitLab rust image to 1.88 for Cargo.lock MSRV

Compare with previous version

added 6 commits <ul><li>97248605...deb4453d - 4 commits from branch <code>main</code></li><li>d8fa2081 - feat(security): pin InstantWithdrawCw20 wire format to ustr-cmm (#21)</li><li>875b7aed - ci: bump GitLab rust image to 1.88 for Cargo.lock MSRV</li></ul> [Compare with previous version](/PlasticDigits/ust1-window/-/merge_requests/10/diffs?diff_id=1950017700&start_sha=972486054323d63f0f728e41e2fa3832afe82b1a)
PlasticDigits commented 2026-08-08 05:29:26 +00:00 (Migrated from gitlab.com)

added 7 commits

  • 875b7aed...586789d1 - 4 commits from branch main
  • 6a946fb8 - feat(security): pin InstantWithdrawCw20 wire format to ustr-cmm (#21)
  • c7180120 - ci: bump GitLab rust image to 1.88 for Cargo.lock MSRV
  • 9f6ed7ee - fix: clean skill merge leftovers and rustfmt for CI

Compare with previous version

added 7 commits <ul><li>875b7aed...586789d1 - 4 commits from branch <code>main</code></li><li>6a946fb8 - feat(security): pin InstantWithdrawCw20 wire format to ustr-cmm (#21)</li><li>c7180120 - ci: bump GitLab rust image to 1.88 for Cargo.lock MSRV</li><li>9f6ed7ee - fix: clean skill merge leftovers and rustfmt for CI</li></ul> [Compare with previous version](/PlasticDigits/ust1-window/-/merge_requests/10/diffs?diff_id=1950023131&start_sha=875b7aed9ac51b6c3f2ed0f8467526ba36769473)
PlasticDigits commented 2026-08-08 05:35:26 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 6be8dda3 - fix(ci): clear clippy redundant_locals in evm_rpc consensus tests

Compare with previous version

added 1 commit <ul><li>6be8dda3 - fix(ci): clear clippy redundant_locals in evm_rpc consensus tests</li></ul> [Compare with previous version](/PlasticDigits/ust1-window/-/merge_requests/10/diffs?diff_id=1950025526&start_sha=9f6ed7eeb283460ab59eb389de12930fdcc9f43e)
PlasticDigits commented 2026-08-08 05:41:34 +00:00 (Migrated from gitlab.com)

added 1 commit

  • a44d137c - fix(ci): inline format args for clippy 1.88 uninlined_format_args

Compare with previous version

added 1 commit <ul><li>a44d137c - fix(ci): inline format args for clippy 1.88 uninlined_format_args</li></ul> [Compare with previous version](/PlasticDigits/ust1-window/-/merge_requests/10/diffs?diff_id=1950027800&start_sha=6be8dda3072c671e8d2eb354b0cf30a5923b950e)
PlasticDigits (Migrated from gitlab.com) merged commit a26793150e into main 2026-08-08 05:48:27 +00:00
PlasticDigits commented 2026-08-08 05:48:28 +00:00 (Migrated from gitlab.com)

mentioned in commit a26793150e

mentioned in commit a26793150eabd6fcaef7491721e6b75033d6a4da
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!43
No description provided.