Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M-12 MitigationConfirmed #47

Open
c4-bot-3 opened this issue Jun 7, 2024 · 1 comment
Open

M-12 MitigationConfirmed #47

c4-bot-3 opened this issue Jun 7, 2024 · 1 comment
Labels
mitigation-confirmed MR-M-12 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@c4-bot-3
Copy link
Contributor

c4-bot-3 commented Jun 7, 2024

Lines of code

Vulnerability details

Original Issue Summary

In the original issue, getRate() does not check for outdated exchange rates, which can result to incorrect calculations.

Mitigation

The mitigation proposes a staleness-check:

-        (uint256 _lastPrice, ) = getMintRate();
+        (uint256 _lastPrice, uint256 _lastPriceTimestamp) = getMintRate();
+        if (block.timestamp > _lastPriceTimestamp + 1 days) {
+            revert OraclePriceExpired();
+        }

Comments

This mitigation succesfully mitigates the original issue. The usage of _lastPriceTimestamp and checking if block.timestamp is more than _lastPriceTimestamp + 1 days will ensure that the price can not be stale.

Suggestion

n/a

Conclusion

LGTM

@c4-judge
Copy link

c4-judge commented Jun 8, 2024

alcueca marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mitigation-confirmed MR-M-12 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

2 participants