Solidity Series

Solidity Programming Language – Overflow

CVE-2018-10299

In simple language, an overflow is when a number gets incremented above its maximum value. Solidity can handle up to 256-bit numbers (up to 2²⁵⁶-1), so incrementing by 1 would result in 0.

In this case, when we click on setter and then press money the value of money becomes 0 this is the problem in the earlier version of solidity 0.5.0.

Now in 0.8.0, we are not having such an issue anymore. When we compile and press setter and then press money we do not get 0 we are still holding the same value which is defined in code “255”

Code:

Version 0.5.0

Hi, I’m saksham dixit

Leave a Reply

Your email address will not be published. Required fields are marked *