FLOW-1: Prevent double-refund on failed CREATE/DEPOSIT#35
FLOW-1: Prevent double-refund on failed CREATE/DEPOSIT#35
Conversation
Pull Request Review: FLOW-1 Double-Refund PreventionSummaryThis PR adds regression test coverage for failed DEPOSIT_TO_YIELDVAULT operations to ensure the refund mechanism correctly credits claimableRefunds rather than allowing double-refunds. The test mirrors the existing test_CompleteProcessing_FailureRefundsBalance coverage for CREATE operations. Code Quality: ExcellentStrengths
Security: StrongRegression Coverage
Contract AlignmentThe test correctly exercises the two-phase commit pattern:
This matches the Cadence worker behavior. Test Coverage: ImprovedWhat This Adds
Existing Coverage Analysis
Recommendations for Future CoverageWhile not blocking for this PR, consider adding:
Performance: No Concerns
Best Practices: Follows Conventions
Minor Observations
Verdict: APPROVEThis PR successfully addresses issue 16 by adding necessary regression coverage for failed DEPOSIT operations. The test is well-structured, security-focused, and maintains consistency with existing test patterns. Checklist
Recommendation: Merge after CI passes. Consider filing a follow-up issue for the ERC20/WITHDRAW test coverage gaps noted above. |
Fixes #16
FLOW-1 is addressed by using a single-path, pull-based refund model (crediting
claimableRefundsand requiring the user toclaimRefund) rather than mixing direct refunds with escrow credits.This PR adds regression coverage for the failed DEPOSIT_TO_YIELDVAULT path (CREATE already has coverage) to ensure failures always result in a claimable refund and never re-introduce double-refund semantics.