Skip to content

feat: use checked_add for milestone amount summation#384

Merged
1nonlypiece merged 2 commits into
Disciplr-Org:mainfrom
Simongodw:feat/checked-amount-sum
May 28, 2026
Merged

feat: use checked_add for milestone amount summation#384
1nonlypiece merged 2 commits into
Disciplr-Org:mainfrom
Simongodw:feat/checked-amount-sum

Conversation

@Simongodw
Copy link
Copy Markdown

@Simongodw Simongodw commented May 26, 2026

Closes #361


This PR improves the safety of the create_vault implementation in contracts/accountability_vault/src/lib.rs by replacing unchecked milestone amount summation with overflow-safe arithmetic using checked_add.

Previously, milestone amounts were accumulated using sum += m.amount, which could potentially panic in edge cases despite release overflow checks. This update ensures safe handling of extreme values and maintains system integrity under all conditions.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 26, 2026

@Simongodw 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! 🚀

Learn more about application limits

@1nonlypiece 1nonlypiece merged commit 85de596 into Disciplr-Org:main May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add i128 overflow-safe milestone amount summation in create_vault in accountability_vault

2 participants