Skip to content

test(erc4626): assert non-integer vault Float reverts before vault call#216

Open
thedavidmeister wants to merge 1 commit into
mainfrom
issue-77-non-integer-vault-float
Open

test(erc4626): assert non-integer vault Float reverts before vault call#216
thedavidmeister wants to merge 1 commit into
mainfrom
issue-77-non-integer-vault-float

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Summary

  • _decode() in LibERC4626 calls toFixedDecimalLossless(vaultFloat, 0) to extract the vault address. A Float with a non-integer value (e.g. packLossless(15, -1) = 1.5) cannot be losslessly converted to 0 decimal places, so the call reverts before any vault interaction occurs.
  • Two tests are added to LibERC4626Test documenting and pinning this behavior:
    • testConvertToAssetsRevertsOnNonIntegerVaultFloat
    • testConvertToSharesRevertsOnNonIntegerVaultFloat
  • The oversized uint160 case (the other part of the issue) is handled by PR fix(lib): bounds-check vault address and token decimals in LibERC4626 #173.

Closes #77

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

Closes #77

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@thedavidmeister, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 42 minutes and 42 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: aa335f61-084f-41d7-99cf-1a8658d53b76

📥 Commits

Reviewing files that changed from the base of the PR and between 7415942 and 8c3b27b.

📒 Files selected for processing (1)
  • test/src/lib/erc4626/LibERC4626.t.sol
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-77-non-integer-vault-float

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.

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.

No test for non-integer / out-of-uint160-range vault Float decode

1 participant