Skip to content

fix(vault): enforce admin auth on divest and restrict emergency access (#1630) - #1688

Merged
Junirezz merged 1 commit into
Junirezz:mainfrom
Awosdot:feature/issue-1630-divest-admin-auth
Oct 19, 2026
Merged

Junirezz merged 1 commit into
Junirezz:mainfrom
Awosdot:feature/issue-1630-divest-admin-auth

Conversation

@Awosdot

@Awosdot Awosdot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Enforced admin authentication (admin.require_auth()) on the divest entrypoint in contracts/vault/src/lib.rs.
  • Updated module documentation at lines 3121–3124 to document admin authorization rules.
  • Added access control tests in vault/tests/access_control_test.rs validating that non-admin calls to divest fail.
  • Confirmed internal emergency divestment through confirm_emergency_action continues to execute seamlessly.

Why

divest was previously exposed as an unauthenticated public function, allowing unauthorized actors to move strategy funds and mutate core vault accounting (watermark and state.total_assets).

How tested

  • Ran cargo test across contract test suites, confirming non-admin divest attempts are rejected and emergency path tests pass.

Closes

Closes #1630

… dedupe routes (Junirezz#1648)

- ConfirmationModal & WithdrawalConfirmationModal now use the shared
  useFocusTrap hook, ignore backdrop clicks and Escape while processing,
  expose dialog/aria-modal/aria-labelledby, and route all copy through t()
- Drawer adopts useFocusTrap so focus is restored on both close and unmount
- ToastCenter closes on Escape, moves focus into the panel, and stays a
  non-modal, non-scroll-locking popover
- useFocusTrap gains trapTab and lockScroll options (backward compatible)
- App.tsx drops duplicate route/ErrorBoundary definitions and wraps the
  not-found route in RouteErrorBoundary
- Remove stale tracked build/test artifacts and extend .gitignore + README
- Repair invalid root package.json (duplicate test script + trailing comma)
- Add modal, drawer, toast-center and routing smoke tests

Closes Junirezz#1620
Closes Junirezz#1621
Closes Junirezz#1629
Closes Junirezz#1564

Co-authored-by: trinnode <trinnode@users.noreply.github.com>
@Junirezz
Junirezz merged commit a21ca5a into Junirezz:main Oct 19, 2026
16 of 26 checks passed
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.

[contract] Require admin auth on public divest or restrict it to the emergency path

2 participants