Validate share minting arithmetic and input bounds in risk pool, clai… - #667
Merged
nonsobethel0-dev merged 2 commits intoSep 29, 2026
Conversation
…ms, and oracle contracts - RiskPool: add checked arithmetic overflow guards for deposit share minting and totals (Parashield-Protocol#641) - ClaimsProcessor: validate maximum dispute reason length in dispute_claim (Parashield-Protocol#642) - PolicyEngine: verify minimum coverage bounds validation (Parashield-Protocol#643) - OracleVerifier: verify and test data_key validation in submit_data (Parashield-Protocol#644)
|
@Alaka-ibr 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! 🚀 |
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.
Summary of Changes
This PR fixes validation and arithmetic overflow issues across RiskPool, ClaimsProcessor, PolicyEngine, and OracleVerifier contracts.
Issues Fixed
checked_addandchecked_mulguards during deposit share calculation and state updates (TotalDeposited,TotalShares,LpPosition) to preventi128arithmetic overflow on extreme values.MAX_DISPUTE_REASON_LEN = 32) andDisputeReasonTooLongerror variant indispute_claim.coverage_min > 0) increate_product.data_keylength validation (validate_key_len) insubmit_data.Testing
Unit tests were added and run across the affected contracts:
test_dispute_claim_empty_reason_failsinclaims-processortest_submit_data_empty_key_failsinoracle-verifierCloses #641
Closes #642
Closes #643
Closes #644