Skip to content

🐛 market: fix double-count in max supply check#803

Merged
cruzdanilo merged 1 commit intomainfrom
fix-max-supply
Apr 30, 2026
Merged

🐛 market: fix double-count in max supply check#803
cruzdanilo merged 1 commit intomainfrom
fix-max-supply

Conversation

@itofarina
Copy link
Copy Markdown
Member

@itofarina itofarina commented Apr 27, 2026

@itofarina itofarina self-assigned this Apr 27, 2026
@itofarina itofarina requested a review from cruzdanilo as a code owner April 27, 2026 19:32
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 27, 2026

🦋 Changeset detected

Latest commit: bf3066c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@exactly/protocol Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Warning

Rate limit exceeded

@itofarina has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 35 minutes and 24 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b2615016-7b8b-4e7f-92dd-8ae072369192

📥 Commits

Reviewing files that changed from the base of the PR and between f8dcef9 and bf3066c.

📒 Files selected for processing (4)
  • .changeset/busy-chicken-win.md
  • .gas-snapshot
  • contracts/Market.sol
  • test/Market.t.sol
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-max-supply

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment thread contracts/Market.sol
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request fixes a bug in the Market contract where the max supply check was double-counting newly minted shares. The afterDeposit hook was incorrectly adding the current shares to the totalSupply, which already included those shares. The check has been updated to only verify the totalSupply against maxSupply. Additionally, a new test case was added to ensure deposits up to the maximum supply are permitted, and gas snapshots were updated. I have no feedback to provide as there are no review comments.

@openzeppelin-code
Copy link
Copy Markdown

🐛 market: fix double-count in max supply check

Generated at commit: bf3066c31e4077d4f2bd0d7c22bab81f8b5db3b7

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
4
0
7
26
39
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.82%. Comparing base (f8dcef9) to head (bf3066c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #803    +/-   ##
========================================
  Coverage   94.82%   94.82%            
========================================
  Files          31       31            
  Lines        2724     2724            
  Branches      457      354   -103     
========================================
  Hits         2583     2583            
  Misses        140      140            
  Partials        1        1            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cruzdanilo cruzdanilo merged commit bf3066c into main Apr 30, 2026
4 of 5 checks passed
@cruzdanilo cruzdanilo deleted the fix-max-supply branch April 30, 2026 14:11
@github-actions github-actions Bot mentioned this pull request Apr 30, 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.

2 participants