File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
// SPDX-License-Identifier: MIT
2
2
pragma solidity >= 0.7.0 < 0.8.0 ;
3
3
4
+ /**
5
+ * @dev Wrappers over Solidity's arithmetic operations with added overflow
6
+ * checks.
7
+ *
8
+ * Arithmetic operations in Solidity wrap on overflow. This can easily result
9
+ * in bugs, because programmers usually assume that an overflow raises an
10
+ * error, which is the standard behavior in high level programming languages.
11
+ * `SafeMath` restores this intuition by reverting the transaction when an
12
+ * operation overflows.
13
+ *
14
+ * Using this library instead of the unchecked operations eliminates an entire
15
+ * class of bugs, so it's recommended to use it always.
16
+ */
17
+
4
18
library SafeMath {
5
19
function safeAdd (uint a , uint b ) internal pure returns (uint c ) {
6
20
c = a + b;
You can’t perform that action at this time.
0 commit comments