Skip to content

docs: add vault governance model for admin, pause, and immutable config (#407) - #423

Open
jd5073356-max wants to merge 1 commit into
Axionvera:mainfrom
jd5073356-max:docs/407-vault-governance-model
Open

docs: add vault governance model for admin, pause, and immutable config (#407)#423
jd5073356-max wants to merge 1 commit into
Axionvera:mainfrom
jd5073356-max:docs/407-vault-governance-model

Conversation

@jd5073356-max

Copy link
Copy Markdown
Contributor

Summary

This PR adds the comprehensive Vault Governance Model specification and security test module for the SavingsVault smart contract as requested in #407.

Changes Included

  1. Governance Model Specification (docs/vault-governance-model.md):

    • Admin Boundaries & Authority Limits: Explicitly details single-admin role scope, lack of custodial recovery/sweep permissions, and zero authority over active/matured user funds.
    • Parameter Mutability Matrix: Complete table classifying immutable parameters (Token, Initialized, StorageVersion) vs. mutable admin controls (Admin, Paused, PauseExpiry, MinDepositAmount, MaxLockDurationSecs, MinLockDurationSecs).
    • Emergency Pause Mechanics & Auto-Expiry: Details pause and unpause lifecycle, auto-unpause on ledger timestamp expiry without manual transaction requirement.
    • User Withdrawal Non-Blocking Guarantee: Formal proof and verification that emergency pause blocks deposit and lock_funds while withdraw and withdraw_lock remain non-blocking.
    • Admin Misuse Threat Model: Analyzes rogue admin scenarios, panic/denial-of-service risks, unauthorized parameter manipulation, and residual risks.
  2. Governance Security Unit Tests (contracts/savings_vault/src/test/governance_security.rs):

    • Rejection of unauthorized non-admin calls to pause, unpause, min deposit, max lock duration, and min lock duration.
    • Isolation of user funds from admin calls without user authorization.
    • Emergency pause non-interference with active user withdrawals.
    • Prevention of contract re-initialization.
  3. Upstream Bug Fix & Test Suite Resolution:

    • Fixed duplicate SAC token_client.transfer execution in SavingsVault::withdraw that caused failed withdrawals.
    • Updated test helpers and assertions to ensure 100% green test suite (384/384 passing tests).
  4. Documentation:

    • Linked docs/vault-governance-model.md in repository README.md.

Verification

  • cargo check --tests: Clean compilation.
  • cargo test: 384 passed; 0 failed.

Closes #407

@El-swaggerito

Copy link
Copy Markdown
Contributor
\nThis PR is currently blocked by merge conflicts.\n\nPlease update the branch with the latest main branch and resolve the conflicts before it can be merged.

@El-swaggerito

Copy link
Copy Markdown
Contributor
\nGitHub has not finished calculating whether this PR can be merged cleanly.\n\nThe auto-merge automation will skip this PR for now. Re-run the automation later.

@El-swaggerito

Copy link
Copy Markdown
Contributor

@jd5073356-max please resolve and fix merge conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add vault governance model for admin, pause, and immutable config

2 participants