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

[audit] #4: Use FixedPointMathLib.mulWad in EDA.currentPrice #59

Merged
merged 3 commits into from
Jul 9, 2024

Conversation

Keshavrajsinghal
Copy link
Contributor

From Spearbit

Description

In this context we have:
uint256 price = (startPrice * uint256(multiplier)) / FixedPointMathLib.WAD;
But one can use the already imported FixedPointMathLib from solday

Recommendation
The context can be replaced by the more optimised version from solady library:
uint256 price = FixedPointMathLib.mulWad(startPrice, uint256(multiplier));

src/lib/EDAPrice.sol Outdated Show resolved Hide resolved
@stevieraykatz stevieraykatz merged commit 1094cd7 into main Jul 9, 2024
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants