fix: add insurance fund mechanism for protocol failures - #685
Open
Marskill65 wants to merge 8 commits into
Open
Conversation
|
@Marskill65 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! 🚀 |
orebams
pushed a commit
to orebams/NeuroWealth-Smartcontract
that referenced
this pull request
Aug 29, 2026
…owealth#686, Neurowealth#687) - AuditTrail: hoist useMemo above the loading-gated early return so hook order stays stable across the loading -> loaded transition - global-error.tsx: catch render-time throws above RootLayout (e.g. in ClientProviders) with the app's branded ErrorPage instead of Next's default unbranded error page - useNotificationPreferences: guard the localStorage JSON.parse with a try/catch that falls back to DEFAULT_PREFERENCES and repairs corrupted storage, matching useNotifications - StrategySelector: add an AbortController to the fetch-on-mount effect, surface failures via an error banner with retry instead of silently treating them as "no strategy saved", and log via lib/logger Closes Neurowealth#684 Closes Neurowealth#685 Closes Neurowealth#686 Closes Neurowealth#687
orebams
pushed a commit
to orebams/NeuroWealth-Smartcontract
that referenced
this pull request
Aug 29, 2026
…ixes fix: round-3 audit follow-ups (Neurowealth#684, Neurowealth#685, Neurowealth#686, Neurowealth#687)
Contributor
|
Pls fix conflict |
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.
Overview
This PR adds a configurable insurance fund mechanism that allocates a portion of protocol yield to a dedicated reserve pool. The reserve is stored as a separate vault balance and is used to backstop eligible user losses from protocol failures or smart contract exploits. It includes owner-managed contribution and payout settings, fund-level monitoring alerts, full test coverage, and documentation.
Related Issue
Closes the insurance fund for protocol failures bounty issue.
Changes
🛡️ Insurance Fund Core
[ADD]
neurowealth-vault/contracts/vault/src/insurance.rsInsuranceFundUpdatedEventon configuration changes and payout events.insurance_fund_balance()getter for transparency.[MODIFY]
neurowealth-vault/contracts/vault/src/topics.rsInsuranceFundUpdatedEventtopics and supporting event constants.[ADD]
neurowealth-vault/contracts/vault/src/tests/test_insurance_fund.rs[MODIFY]
neurowealth-vault/contracts/vault/src/tests/mod.rs🖥️ Admin, Monitoring & Docs
[ADD]
packages/admin-panel/src/components/InsuranceConfiguration.tsx[MODIFY]
packages/monitoring/src/monitor.ts[ADD]
docs/INSURANCE.mdVerification Results
insurance_fund_balance()getter returns current reserveCloses #661