(Lesson 12 - ERC20) Overflow - Solved #759
-
Could someone elaborate how the following code actually checks for overflow?
Thank you! |
Beta Was this translation helpful? Give feedback.
Answered by
PatrickAlphaC
Jul 6, 2022
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
-
This is probably a little outdated code, but in earlier versions of solidity, if you made a number that was larger than the largest number, it would "wrap" back to 0. So this line makes sure we don't wrap back to 0. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
PatrickAlphaC
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is probably a little outdated code, but in earlier versions of solidity, if you made a number that was larger than the largest number, it would "wrap" back to 0.
So this line makes sure we don't wrap back to 0.