Skip to content

fix(sflr): revert on zero rate from sFLR contract#175

Open
thedavidmeister wants to merge 2 commits into
mainfrom
issue-80-sflr-zero-check
Open

fix(sflr): revert on zero rate from sFLR contract#175
thedavidmeister wants to merge 2 commits into
mainfrom
issue-80-sflr-zero-check

Conversation

@thedavidmeister

Copy link
Copy Markdown
Collaborator

Summary

  • Adds ZeroSFLRRate error to src/err/ErrFtso.sol
  • Guards LibSceptreStakedFlare.getSFLRPerFLR18() against a zero return from the sFLR proxy — reverts with ZeroSFLRRate instead of forwarding a zero exchange rate to oracle consumers
  • Adds testGetSFLRPerFLR18ZeroReverts() using vm.mockCall to verify the guard fires
  • Regenerated FlareFtsoWords.pointers.sol with updated bytecode hash

Closes #80

🤖 Generated with Claude Code

Adds ZeroSFLRRate error (ErrFtso.sol) and a guard in getSFLRPerFLR18():
if the sFLR contract returns 0 (e.g. uninitialized), revert instead of
silently forwarding a zero exchange rate to oracle consumers.

Adds a unit test using vm.mockCall to verify the zero-rate revert.
Regenerated FlareFtsoWords.pointers.sol (new bytecode hash).

Closes #80

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 34 minutes and 19 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: 1c6a90cd-6299-4b18-85f5-5af29bd2e750

📥 Commits

Reviewing files that changed from the base of the PR and between cb20d03 and 32eb4c7.

⛔ Files ignored due to path filters (1)
  • src/generated/FlareFtsoWords.pointers.sol is excluded by !**/generated/**
📒 Files selected for processing (3)
  • src/err/ErrFtso.sol
  • src/lib/sflr/LibSceptreStakedFlare.sol
  • test/src/lib/sflr/LibSceptreStakedFlare.t.sol
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-80-sflr-zero-check

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.

[F29] [LOW] No validation that external sFLR contract returns a non-zero / sane rate before propagating to oracle

1 participant