implement optional insurance fund system for vaults#612
Merged
vic-Gray merged 2 commits intoJun 28, 2026
Conversation
- Add InsuranceClaim entity with vault/depositor relationships and status tracking - Create InsuranceFundService with Soroban multisig escrow, coverage ratio calculation - Add depositToFund, processIncident, declareIncident methods with proper auth - Implement pro-rata payout distribution when insufficient insurance funds - Add duplicate claim prevention for incident workflow - Create getAuditTrail for public on-chain auditability - Add InsuranceFundController with REST endpoints - Add comprehensive unit and integration tests (47 tests passing)
|
Someone is attempting to deploy a commit to the vic's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@mrmoney10010-design 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! 🚀 |
testersweb0-bug
pushed a commit
to testersweb0-bug/Harvest-Finance
that referenced
this pull request
Jun 28, 2026
Remove the redundant bcrypt.compare call that re-verified the token after it had already been confirmed inside the activeUsers loop. The MoreThan(new Date()) query ensures only users whose resetPasswordExpires > NOW() are loaded from the database, so expired tokens are rejected at the query level before any token-hash comparison occurs. Add explicit User | null type annotation on the loop accumulator to resolve the TypeScript narrowing error introduced by the implicit null start value. Update auth.service.spec.ts: - Add find: jest.fn() to the mock repository (the service uses find(), not findOne(), for this flow) - Replace the broken tests that were mocking findOne with correct find-based tests - Add coverage for: no active tokens, hash mismatch, null token, successful reset, and expired-token rejection Fixes code-flexing#315 Fixes code-flexing#612
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.
Area: backend · Effort: L
What: Implement an optional insurance fund that vault operators can fund to cover depositor losses in the event of a smart contract exploit or strategy failure.
Why: Insurance funds are a powerful trust signal that separates professional vault operators from anonymous ones. They directly address the biggest user concern: 'what if I lose my funds?'
closes #578