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

Why overflows are desired in the UniswapV2OracleLibrary contract? #131

Open
RoseRompkxm opened this issue Sep 13, 2022 · 1 comment
Open

Comments

@RoseRompkxm
Copy link

I've noticed there are comments for the following code saying addition overflow is desired & subtraction overflow is desired, what's the purpose behind? Can anyone enlighten me this? Thanks a lot!

https://github.com/Uniswap/v2-periphery/blob/master/contracts/libraries/UniswapV2OracleLibrary.sol#L28

@jukanntenn
Copy link

This answer from stackoverflow gives a good explanation. I guess overflow do not change the final result, but I have't play this math game.

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

No branches or pull requests

2 participants