Skip to content

Set vault, oracle and token parameters from the console - #231

Open
luchobonatti wants to merge 10 commits into
feat/195-emergency-surfacefrom
feat/196-configuration-surface
Open

luchobonatti wants to merge 10 commits into
feat/195-emergency-surfacefrom
feat/196-configuration-surface

Conversation

@luchobonatti

Copy link
Copy Markdown
Member

Summary

Closes #196

The Configuration tab sets the vault, oracle and share-token parameters, showing the current and new value and checking the contract's bounds before signing.

Changes

  • Vault governance sets the deposit cap, custodian, notice and wind-down delay; the oracle admin sets the oracle limits; the share-token admin sets the compliance contract and identity verifier
  • Each field is prefilled with the current value; the button needs a change and every bound the contract enforces, each named per field
  • The action rail takes several keyed fields and text inputs; parseDuration reads seconds or d/h/m/s
  • Action builders and the transaction hook factory are shared across the admin surfaces
  • An unchanged action reads "No change"; retrying a "no cap" submission works

Acceptance criteria

  • Current value and new value side by side before a signature is requested
  • Bounds mirrored client-side from the contract's own checks
  • A refused action names the contract error

Test plan

Automated tests

npm run test — 1229 passing.

Manual verification

  1. On a local network, open /admin/configuration as governance: seven setters, each reading "No change".
  2. Set the notice to 10d with a 7-day upgrade delay: "Notice ≤ upgrade delay 7d" is unmet and the button is disabled.

Breaking changes

None.

Checklist

  • Self-reviewed my own diff
  • Tests added or updated
  • Docs updated (if applicable)
  • No unrelated changes bundled in

Screenshots

None.

Copilot AI balanced review requested due to automatic review settings October 13, 2026 21:23
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
strata-vault-kit-app Ready Ready Preview Oct 14, 2026 6:29pm UTC

Request Review

Copilot AI 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.

🔵 Needs a closer look

It is a large, security-sensitive feature spanning ~24 files that expands admin authorization surfaces and adds on-chain financial-parameter setters, so final human review is warranted despite no concrete defects being found.

0 open findings

What changed in this PR

This PR adds a Configuration admin surface (/admin/configuration) that lets the relevant authorities change vault, oracle, and share-token parameters. Vault governance sets the deposit cap, custodian, notice and wind-down delay; the oracle admin sets the oracle limits; the share-token admin sets the compliance contract and identity verifier. Each field is prefilled with the current value, shows current-vs-new side by side, and mirrors the contract's bounds client-side before a signature is requested, with refusals mapped to named contract errors. It fits into the existing admin panel alongside the Cycle and Emergency surfaces, reusing the CycleActionRail and TransactionModal infrastructure.

Changes:

  • New Configuration surface: state hook (useConfigurationState), write hooks (useConfigurationTransactions), page logic (configuration.ts), and UI (ConfigurationSection), wired into AdminPanel and useAdminAuthority (oracle/token admins now reach configuration).
  • Shared extraction/refactors: toAction/Spec/ROLES moved into actions.ts; adminTransaction factory extracted into useAdminTransaction; parseDuration + parameterized formatDuration and several formatters exported from cycle.ts.
  • CycleActionRail gains keyed multi-field support with current/new value display; TransactionModal gains configuration copy and admin error-code mappings; usePendingTransaction now retries null-valued args correctly.
File Description
app/​src/​pages/​configuration.ts New: parses inputs, mirrors contract bounds, builds setter specs/actions and parameter groups
app/​src/​pages/​configuration.test.ts New: thorough coverage of actions, bounds, prefills and groups
app/​src/​hooks/​useConfigurationState.ts New: reads current vault/oracle/token parameters for the surface
app/​src/​hooks/​useConfigurationTransactions.ts New: setter write hooks with query-key invalidation
app/​src/​hooks/​useConfigurationState.test.ts New: covers gathering/checking/unreadable/polling
app/​src/​hooks/​useAdminTransaction.ts New: shared admin transaction factory extracted from emergency
app/​src/​hooks/​useAdminTransaction.test.ts Adds configuration setter cases to the shared factory tests
app/​src/​components/​admin/​ConfigurationSection.tsx New: surface component wiring state, actions, inputs and modal
app/​src/​components/​admin/​ConfigurationSection.test.tsx New: renders, submits, resets inputs, modal/polling-by-active
app/​src/​components/​admin/​CycleActionRail.tsx Keyed multi-field support, current/new display, text inputMode
app/​src/​components/​admin/​CycleActionRail.module.css Styles for keyed field head/labels/values
app/​src/​components/​admin/​CycleActionRail.test.tsx Tests keyed fields and "No change" summary
app/​src/​pages/​actions.ts Moves ROLES/Spec/toAction here; adds unchanged readiness and field metadata
app/​src/​pages/​actions.test.ts Tests toAction and unchanged readiness
app/​src/​pages/​emergency.ts Imports shared ROLES/Spec/toAction instead of local copies
app/​src/​pages/​cycle.ts Adds parseDuration, parameterizes formatDuration, exports formatters/oracleLimitRows
app/​src/​pages/​cycle.test.ts Tests parseDuration and exact formatDuration
app/​src/​pages/​AdminPanel.tsx Routes the configuration surface to ConfigurationSection
app/​src/​pages/​AdminPanel.test.tsx Tests configuration surface rendering/active state
app/​src/​components/​vault/​TransactionModal.tsx Adds configuration action copy and admin error-code reasons
app/​src/​components/​vault/​TransactionModal.test.tsx Tests configuration modal states and refusal messages
app/​src/​hooks/​useAdminAuthority.ts Grants configuration to oracle/share-token admins; exports adminAuthorityKey
app/​src/​hooks/​useAdminAuthority.test.ts Updates expected surfaces/grantedBy
app/​src/​hooks/​useCycleState.ts Exports useCycleReads/CycleReads for reuse
app/​src/​hooks/​useVaultAuthorities.ts Exports vaultAuthoritiesKey
app/​src/​hooks/​useIsAllowed.ts Exports isAllowedKey
app/​src/​hooks/​useEmergencyTransactions.ts Switches to shared adminTransaction factory
app/​src/​hooks/​usePendingTransaction.ts Boxes the pending arg so null args retry correctly
app/​src/​hooks/​usePendingTransaction.test.ts Tests retry of a null arg

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch was successfully deployed

1 active deployment
Preview — 7d4055ce Deployed Oct 14, 2026 by vercel[bot]
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.

Configuration surface: vault and oracle parameters

3 participants