Skip to content

Avoid Divide by 0 in compute Deviation Ratio#271

Merged
brandoniles merged 1 commit intomainfrom
perp-zero-tvl-check
Mar 10, 2026
Merged

Avoid Divide by 0 in compute Deviation Ratio#271
brandoniles merged 1 commit intomainfrom
perp-zero-tvl-check

Conversation

@brandoniles
Copy link
Member

In the case where perp's tvl is zero, for example if all notes are redeemed, the divide by zero would revert other user functions.

@brandoniles brandoniles requested a review from aalavandhan March 2, 2026 23:44
@openzeppelin-code
Copy link

openzeppelin-code bot commented Mar 2, 2026

Avoid Divide by 0 in compute Deviation Ratio

Generated at commit: d6f5f3b90b62a874d0d2f42d7c83882dc7d40b56

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
1
0
0
3
24
28
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@brandoniles brandoniles force-pushed the perp-zero-tvl-check branch from 6bd5755 to d6f5f3b Compare March 10, 2026 22:51
@brandoniles brandoniles merged commit b824218 into main Mar 10, 2026
1 of 2 checks passed
@brandoniles brandoniles deleted the perp-zero-tvl-check branch March 10, 2026 23:11
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