fix: contract address guard, re-entrancy protection, dispute-locked refund, and BPS sum validation#458
Merged
Ibinola merged 1 commit intoJun 29, 2026
Conversation
…refund, and bps validation Closes Lead-Studios#434 Closes Lead-Studios#431 Closes Lead-Studios#428 Closes Lead-Studios#425
|
@prismn 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
This PR addresses four security and correctness issues across the contract:
Changes
#434 — Prevent tokens being sent to the contract address via
transferandmintInvalidRecipientguard intransfer(was missing; already present intransfer_fromandmintfor the minting path)create_escrowinstead#431 — Re-entrancy protection in
distributerecord.distributed = trueand the storage write to BEFORE the distribution loopdistributenow seesdistributed = trueimmediately and panics, closing the double-distribution window#428 — Block
refund_escrowwhen a dispute is activetry_refund_escrowfor an openEscrowDisputerecordDisputeOpentest_refund_escrow_with_open_dispute_panics#425 — Validate that
share_bpsvalues sum to exactly 10000 increate_splittest_create_split_shares_sum_to_10000_ok,test_create_split_shares_sum_to_9999_panics,test_create_split_shares_sum_to_10001_panicsAlso fixed pre-existing compilation errors in the upstream branch (duplicate imports, duplicate enum variants, symbol length violations, missing imports) to restore a clean library build.
Closes #434
Closes #431
Closes #428
Closes #425