Repository navigation
feat(contracts): round penalties in protocol favour and enforce parti… - #2125
Merged
1nonlypiece merged 2 commits intoOct 24, 2026
Conversation
…al withdrawal minimums Closes Commitlabs-Org#2094 - Add shared penalty_for(amount, penalty_bps) helper using ceiling division ceil(amount * bps / 10_000) with checked arithmetic and clamping. - Replace duplicate inline penalty computations in efund_partial, execute_refund, and esolve_dispute with penalty_for. - Enforce MIN_PARTIAL_WITHDRAWAL (10_000_000 stroops / 1 XLM) and MIN_REMAINING_PRINCIPAL (10_000_000 stroops / 1 XLM) on efund_partial, returning Error::BelowMinimum = 18 unless remaining is 0. - Update contracts/README.md with entrypoints, configuration surface, error table, and a dedicated 'Penalty math' section. - Add test suite in contracts/escrow/src/test_penalty_math.rs covering unit cases, property-based tests, integration minimums/balances, and slicing regression tests.
|
@Stephan-Thomas is attempting to deploy a commit to the 1nonly's projects Team on Vercel. A member of the Team first needs to authorize it. |
…olve conflicts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
…al withdrawal minimums
Closes #2094
efund_partial, execute_refund, and
esolve_dispute with penalty_for.
efund_partial, returning Error::BelowMinimum = 18 unless remaining is 0.
Description
Please include a summary of the changes and the related issue. List any dependencies that are required for this change.
Closes # (issue number)
Type of Change
Please delete options that are not relevant.
Checklist
Please review the Developer Guide before checking the items below:
DEVELOPER_GUIDE.md,README.md, or inline files).pnpm run test:coverageornpm run test:coverage).pnpm lintornpm run lint) and fixed all error diagnostics.Visual Changes (if applicable)
Please add screenshots, screen recordings, or GIFs showcasing the user interface changes.
Join the Discussion
Need help or want to chat? Join our CommitLabs Discord server.