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

PRECISION #54

Open
codehawks-bot opened this issue Aug 5, 2023 · 0 comments
Open

PRECISION #54

codehawks-bot opened this issue Aug 5, 2023 · 0 comments

Comments

@codehawks-bot
Copy link

PRECISION

Severity

Gas Optimization / Informational

Relevant GitHub Links

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/d1c5501aa79320ca0aeaa73f47f0dbc88c7b77e2/src/DSCEngine.sol#L331C10-L331C10

Summary

There is a constant variable called PRECISION = 1e18. So that we can use PRECISION instead of 1e18 everywhere in the codebase.

Vulnerability Details

return (collateralAdjustedForThreshold * 1e18) / totalDscMinted;
In above code => PRECISION = 1e18

Impact

Gas Optimization

Tools Used

Manual Review

Recommendations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants