Repository navigation
Phase 1: vault and factory contracts - #108
Merged
Merged
Conversation
Vault: plan controls, bounded execute_buy with optional deposit-address storage registration and a failure callback that restores the schedule, owner withdraw and token recovery, ft_on_transfer, NEP-297 events. Factory: admin uploads vault code once (future vaults only), keeper-only create_vault_for with one vault per owner and a daily cap, rollback on a failed deploy, chained USDC registration plus retry_registration. Tests: 24 vault and 9 factory unit tests, 16 near-workspaces sandbox tests covering invariants I1-I7, private callbacks, registration, insufficient balance, factory rules and recovery. Adds a test-only mock-ft crate.
near-workspaces compile_project shells out to the cargo near CLI.
MFrancis-dev
added a commit
that referenced
this pull request
Nov 4, 2026
Vault and factory per ARCHITECTURE §3 (KD-5, KD-8); 49 contract tests incl. 16 near-workspaces sandbox tests; CI installs cargo-near for them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the Stack contracts per ARCHITECTURE.md §3 and decisions KD-5 (immutable vaults) and KD-8 (regular deploy).
What changed
set_plan/resume/pause, boundedexecute_buy(keeper, once per interval, ≤amount_per_run, optional storage registration of the deposit address, schedule restored on failure),withdraw,recover_token,ft_on_transfer, NEP-297 events.set_vault_code(admin, future vaults only),create_vault_for(keeper, one per owner, daily cap), rollback on failed deploy, chained USDC registration,retry_registration, code-hash view.mock-ftcrate.Wasm: vault 137 KB, factory 146 KB (~1.5 NEAR locked per vault).
Closes #20
Closes #21
Closes #22
Closes #23
Closes #24
Closes #25
Closes #26
Closes #27
Closes #28
Closes #29
Closes #31
Roadmap
Checks
cargo test(unit + sandbox),cargo clippyclean,pnpm contracts:buildpnpm typecheck && pnpm lintNEAR HACKATHON rules
near-contract-standardsin the test-only mock) to be listed in the README (K10.3)Not done