Skip to content

feat(vault,dx): add vault config setters, devcontainer, vscode tasks, and make doctor - #639

Merged
Elizabethxxx merged 2 commits into
0xLizTech:mainfrom
Tyreenn:feat/vault-config-setters-and-dx-tooling
Oct 26, 2026
Merged

Elizabethxxx merged 2 commits into
0xLizTech:mainfrom
Tyreenn:feat/vault-config-setters-and-dx-tooling

Conversation

@Tyreenn

@Tyreenn Tyreenn commented Oct 22, 2026

Copy link
Copy Markdown

closes #69
closes #81
closes #82
closes #86

Summary

  • Vault configuration mutability and admin setters (vault: decide whether VaultConfig gets admin setters for the compliance binding and supply cap #69):
    • Record the field-by-field mutability decision and rationale for every VaultConfig field (plus decimals) in docs/architecture/006-vault.md under Decision and Consequences.
    • Add admin-authorized set_compliance(compliance, min_level) to rebind or clear compliance screening at runtime and emit ComplianceSet, enforcing min_level <= MAX_COMPLIANCE_LEVEL (3, matching compliance::MAX_LEVEL) in both __constructor and set_compliance with VaultError::InvalidComplianceLevel (16).
    • Add admin-authorized tighten-only set_max_share_supply(max_share_supply) matching rwa-asset (Let the admin tighten a supply cap but never raise it #54 / IR-02), rejecting negative, loosening, or below-supply caps with VaultError::InvalidSupplyCap (17) and emitting MaxShareSupplySet.
    • Keep lockup_secs, underlying, exchange_rate, decimals, name, and symbol immutable.
    • Amend ADR-002, ADR-003, and ADR-004 for the vault authorization map, error discriminant allocations (VaultError 1-17), and screened operations.
    • Add unit and integration test coverage for all new entry points, events, authorization checks, and refused transitions.
  • Devcontainer configuration (Add a devcontainer with Rust, stellar-cli and Node preinstalled #81):
    • Add .devcontainer/devcontainer.json pinned to rust-toolchain.toml (1.98.1, wasm32v1-none, rustfmt, clippy), stellar-cli 27.1.0 (verified by SHA-256 matching .github/workflows/contracts-ci.yml), and Node.js 22, running npm ci in sdk/ on creation.
  • VS Code tasks (Add a VS Code tasks.json for build, test and lint #82):
    • Add .vscode/tasks.json with tasks for make build, make lint, make test, and npm test grouped as build and test tasks, documented in CONTRIBUTING.md.
  • Toolchain verification target (Add a make doctor target that checks the toolchain #86):
    • Add make doctor and scripts/doctor.sh to check rustc, wasm32v1-none, stellar-cli, node, and npm against expected versions and exit non-zero on any missing or mismatched dependency.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --all --features testutils

… and make doctor

Resolve 0xLizTech#69, 0xLizTech#81, 0xLizTech#82, and 0xLizTech#86:
- Add VaultContract foundation, ADR-006 mutability policy, and admin setters set_compliance and set_max_share_supply with ComplianceSet and MaxShareSupplySet events
- Enforce MAX_COMPLIANCE_LEVEL (3) in constructor and set_compliance (InvalidComplianceLevel = 16) and tighten-only cap transitions (InvalidSupplyCap = 17)
- Amend ADR-002, ADR-003, and ADR-004 for vault entry points and error discriminants
- Add .devcontainer/devcontainer.json pinned to rust-toolchain.toml, stellar-cli 27.1.0, and Node 22 with sdk npm ci on creation
- Add .vscode/tasks.json for make build, make lint, make test, and npm test
- Add make doctor target and scripts/doctor.sh to check rustc, wasm32v1-none, stellar-cli, node, and npm versions
@drips-wave

drips-wave Bot commented Oct 22, 2026

Copy link
Copy Markdown

@Tyreenn Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@OrderStream OrderStream left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Architecturally sound vault mutability controls and developer ergonomics:

  • Security controls: Enforcing tighten-only semantics on set_max_share_supply prevents malicious or accidental supply cap inflation.
  • Event emission: Emitting ComplianceSet and MaxShareSupplySet ensures off-chain indexers stay synchronized with contract state mutations.
  • DX consistency: Adding .devcontainer and scripts/doctor.sh guarantees new contributors match the exact compiler target (wasm32v1-none) and CLI versions.
  • Minor note: Verify �dmin.require_auth() is called at the very entry of set_compliance prior to reading storage keys to save metering execution units on failed authorizations.

# Conflicts:
#	.github/workflows/contracts-ci.yml
#	CHANGELOG.md
#	Makefile
#	contracts/governance/src/lib.rs
#	contracts/vault/src/error.rs
#	contracts/vault/src/events.rs
#	contracts/vault/src/lib.rs
#	contracts/vault/src/test.rs
#	contracts/vault/src/token.rs
#	contracts/vault/tests/test_vault.rs
#	docs/architecture/003-upgrade-path.md
#	docs/architecture/004-cross-contract-interaction.md
#	docs/architecture/006-vault.md
@Elizabethxxx
Elizabethxxx merged commit 796218e into 0xLizTech:main Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants