Skip to content

fix(blend-adapter): guard subtraction against negative deltas - #1182

Merged
collinsezedike merged 1 commit into
drydocs:mainfrom
laxjovial:fix-blend-adapter-unchecked-subtraction
Oct 23, 2026
Merged

collinsezedike merged 1 commit into
drydocs:mainfrom
laxjovial:fix-blend-adapter-unchecked-subtraction

Conversation

@laxjovial

@laxjovial laxjovial commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Guard the Blend adapter deposit and withdraw subtraction with an explicit negative-delta check and checked_sub, panicking with ContractError::Overflow.
  • Add mock-pool coverage for below-baseline collateral and recipient balances.

Test plan

  • cargo test -p meridian-blend-adapter passes under packages/contracts
  • Soroban contract CI passes

Closes #1106

@vercel

vercel Bot commented Oct 19, 2026

Copy link
Copy Markdown

@laxjovial is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@laxjovial 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

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guarded subtraction and the two new tests are correct. Amend the commit subject, which is 75 characters and fails the required Commit Messages check, for example fix(blend-adapter): guard subtraction against negative deltas. Also unindent the PR body so Closes #1106 is parsed; the current four-space indent turns it into a code block and GitHub does not link the issue. The PR title is truncated at ov…; complete or shorten it.

@collinsezedike collinsezedike changed the title fix(blend-adapter): guard deposit and withdraw subtraction against ov… fix(blend-adapter): guard subtraction against negative deltas Oct 23, 2026
@collinsezedike
collinsezedike force-pushed the fix-blend-adapter-unchecked-subtraction branch from 9c65c11 to 983c6b4 Compare October 23, 2026 15:52

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laxjovial Thank you for your contribution. If you are interested, there are more open issues to pick up.

@collinsezedike
collinsezedike merged commit ad5af61 into drydocs:main Oct 23, 2026
10 of 11 checks passed
@collinsezedike

Copy link
Copy Markdown
Collaborator

@laxjovial Thank you for your contribution. If you found Meridian useful, please star the repository: https://github.com/drydocs/meridian.

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.

[Bug] BlendAdapter uses unchecked subtraction where DefindexAdapter guards it

2 participants