Name | description | test cases |
---|---|---|
Integer overflow and underflow | Integer types have maximum values. Overflow and underflow bugs can occur when you exceed the maximum value (overflow) or when you go below the minimum value (underflow) | Example |
Reentrancy | Reentrancy is an attack that can occur when a bug in a contract function can allow a function interaction to proceed multiple times when it should otherwise be prohibited | Example |
Unprotected withdrawal | Without adequate access controls, bad actors may be able to withdraw some or all assets from a contract | Example |
Unchecked low-level calls | The return value of a low-level call is not checked | [Example](https://github.com/crytic/sli |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.8.0 <0.9.0; | |
contract CheckIntOverflow { | |
//57896044618658097711785492504343953926634992332820282019728792003956564819967 | |
int256 public constant INT256_MAX = type(int256).max; | |
//115792089237316195423570985008687907853269984665640564039457584007913129639935 | |
uint256 public constant UNT256_MAX = type(uint256).max; |