Hack Solidity: Integer Overflow and Underflowby@kamilpolak
9,859 reads

Hack Solidity: Integer Overflow and Underflow

tldt arrow
EN
Read on Terminal Reader🖨️
JS🚫

Too Long; Didn't Read

The easiest way to avoid overflow and underflow in Solidity is to use at least a 0.8 version of the Solidity compiler. In Solidity 0.7, the compiler will automatically take care of checking for overflows and underflows. Let's create a simple smart contract called "ChangeBalancesol" The initial balance is 0.0. If you press the "decrease" button, then the "balance" is decremented by one. Let’s see what happened next and how it works in practice.

Coin Mentioned

Mention Thumbnail
featured image - Hack Solidity: Integer Overflow and Underflow
Kamil Polak HackerNoon profile picture

@kamilpolak

Kamil Polak

About @kamilpolak
LEARN MORE ABOUT @KAMILPOLAK'S EXPERTISE AND PLACE ON THE INTERNET.
react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa