Repository navigation
feat(app): name the NAV pause and follow the oracle's bounds - #339
luchobonatti wants to merge 2 commits into
Conversation
The oracle renamed raise_ripcord to pause_nav and set_ripcord to set_nav_paused. Emergency, Cycle, /sign, the transaction modal and the hooks follow it. Closes #302
The oracle made max_down_bps required and bounded its config. The form drops "No limit", mirrors validate_config, and Attest price explains a paused NAV. Closes #303
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
🔵 Needs a closer look
Although I found no issues and verified the renames and form bounds against the contract, the change spans the oracle emergency-stop and config-validation surfaces of a financial vault admin console, which warrants a final human sign-off.
No open issues 🎉
What changed in this PR
This PR updates the admin console to track two upstream contract changes in the NAV oracle (issues #302 and #303). First, the oracle's emergency stop was renamed from "ripcord" to the "NAV pause" (raise_ripcord→pause_nav, set_ripcord→set_nav_paused, RipcordNotRaised→NavNotPaused), so the console is retitled to match everywhere it appears. Second, the oracle made max_down_bps required and bounded its config, so the "Set the oracle limits" form drops the "No limit" option and tightens its validation to mirror the contract's validate_config.
I verified the changes are correct and internally consistent:
- The rename is complete — no
ripcord/raise_ripcord/set_ripcordremains inapp/orapp-lib/(nor ine2e/,scripts/, ordocs/). - The new form bounds exactly mirror
nav-oraclevalidate_config(freshness 1s–35d, cooldown 1s–freshness, both bps 1–10000, floor > 0, ceiling floor–1,000,000×WAD), andMAX_CEILING = 1_000_000 × 10^18equals the contract'sMAX_ANSWER. - The simplified
withinAllowedMove(price >= floor && price <= ceiling) matches the contract's deviation check, and new error copy for codes 3008/3010 matches the renamed/added oracle errors.
Changes:
- Rename the oracle emergency stop to the "NAV pause" across Emergency, Cycle,
/sign, the transaction modal, and the emergency/cycle hooks. - Make "Largest fall" required and tighten the oracle-config form bounds to the contract's limits; drop "No limit".
- Add attest refusal copy for the new
NavPaused(3010) error and update all affected tests.
| File | Description |
|---|---|
| app/src/pages/sign.ts | Renames oracle decoders/actions to pause_nav/set_nav_paused; always shows "Largest fall" as a percent. |
| app/src/pages/sign.test.ts | Updates and adds tests for the renamed pause actions and set_config limits. |
| app/src/pages/emergency.ts | Renames specs/labels/conditions to the NAV pause; pauseGrant/pauseSpec/navPaused. |
| app/src/pages/emergency.test.ts | Updates emergency action/tile expectations to NAV-pause wording. |
| app/src/pages/cycle.ts | Renames ripcord→navPaused; removes the nullable maxDownBps branch in the move/limit rows. |
| app/src/pages/cycle.test.ts | Updates fixtures/tests for required maxDownBps and NAV-pause labels. |
| app/src/pages/configuration.ts | New bounds constants; replaces RISE/FALL with a shared MOVE kind; rewrites oracleBounds to mirror the contract. |
| app/src/pages/configuration.test.ts | Adds the required-fall case and the new bound-label assertions. |
| app/src/hooks/useEmergencyTransactions.ts | Renames hooks/calls to usePauseNav/useSetNavPaused and pause_nav/set_nav_paused. |
| app/src/hooks/useCycleState.ts | Makes OracleLimits.maxDownBps non-null and renames ripcord→navPaused. |
| app/src/hooks/useCycleState.test.ts, useConfigurationState.test.ts, useAdminTransaction.test.ts, useOracleState.test.ts | Update fixtures/mocks for the rename and required maxDownBps. |
| app/src/components/vault/TransactionModal.tsx | Renames emergency action union/copy; adds 3010 reason "Unpause the NAV first." |
| app/src/components/vault/TransactionModal.test.tsx | Adds 3010 case and updates emergency-action expectations. |
| app/src/components/admin/EmergencySection.tsx | Renames submit/flow wiring to the NAV pause actions. |
| app/src/components/admin/EmergencySection.test.tsx, CycleSection.test.tsx, CycleActionRail.test.tsx, ConfigurationSection.test.tsx | Update mocks/fixtures and assertions for the rename and required fall. |
Review effort: Balanced
Summary
Closes #302
Closes #303
The oracle renamed its emergency stop and made
max_down_bpsrequired with bounded config; the console still used the old names and offered "No limit".Changes
/sign, the transaction modal and the hooks callpause_navandset_nav_pausedand say "Pause the NAV", "Unpause the NAV", "NAV paused"/signalways show Largest fall as a percentNavPausedreads "Unpause the NAV first."UseTimelockafter setup; Run the oracle's admin changes through its timelock #337 covers itAcceptance criteria
ripcordleft inapp/orapp-lib//signdescribespause_navandset_nav_pausedNavPausedreads "Unpause the NAV first"Test plan
Automated tests
npm cinpx vitest run app/srcManual verification
feedbackcontracts to a local network and generate the app clients from them/admin/emergencywith the oracle admin/admin/configuration, expand Set the oracle limitsBreaking changes
None.
Checklist
Screenshots