Commit ccf79ee4 by Nicolás Venturo

Fix SafeMath docs

parent ecf0725d
...@@ -23,6 +23,7 @@ library SafeMath { ...@@ -23,6 +23,7 @@ library SafeMath {
* Counterpart to Solidity's `+` operator. * Counterpart to Solidity's `+` operator.
* *
* Requirements: * Requirements:
*
* - Addition cannot overflow. * - Addition cannot overflow.
*/ */
function add(uint256 a, uint256 b) internal pure returns (uint256) { function add(uint256 a, uint256 b) internal pure returns (uint256) {
...@@ -39,6 +40,7 @@ library SafeMath { ...@@ -39,6 +40,7 @@ library SafeMath {
* Counterpart to Solidity's `-` operator. * Counterpart to Solidity's `-` operator.
* *
* Requirements: * Requirements:
*
* - Subtraction cannot overflow. * - Subtraction cannot overflow.
*/ */
function sub(uint256 a, uint256 b) internal pure returns (uint256) { function sub(uint256 a, uint256 b) internal pure returns (uint256) {
...@@ -52,6 +54,7 @@ library SafeMath { ...@@ -52,6 +54,7 @@ library SafeMath {
* Counterpart to Solidity's `-` operator. * Counterpart to Solidity's `-` operator.
* *
* Requirements: * Requirements:
*
* - Subtraction cannot overflow. * - Subtraction cannot overflow.
*/ */
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
...@@ -68,6 +71,7 @@ library SafeMath { ...@@ -68,6 +71,7 @@ library SafeMath {
* Counterpart to Solidity's `*` operator. * Counterpart to Solidity's `*` operator.
* *
* Requirements: * Requirements:
*
* - Multiplication cannot overflow. * - Multiplication cannot overflow.
*/ */
function mul(uint256 a, uint256 b) internal pure returns (uint256) { function mul(uint256 a, uint256 b) internal pure returns (uint256) {
...@@ -93,6 +97,7 @@ library SafeMath { ...@@ -93,6 +97,7 @@ library SafeMath {
* uses an invalid opcode to revert (consuming all remaining gas). * uses an invalid opcode to revert (consuming all remaining gas).
* *
* Requirements: * Requirements:
*
* - The divisor cannot be zero. * - The divisor cannot be zero.
*/ */
function div(uint256 a, uint256 b) internal pure returns (uint256) { function div(uint256 a, uint256 b) internal pure returns (uint256) {
...@@ -108,6 +113,7 @@ library SafeMath { ...@@ -108,6 +113,7 @@ library SafeMath {
* uses an invalid opcode to revert (consuming all remaining gas). * uses an invalid opcode to revert (consuming all remaining gas).
* *
* Requirements: * Requirements:
*
* - The divisor cannot be zero. * - The divisor cannot be zero.
*/ */
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
...@@ -127,6 +133,7 @@ library SafeMath { ...@@ -127,6 +133,7 @@ library SafeMath {
* invalid opcode to revert (consuming all remaining gas). * invalid opcode to revert (consuming all remaining gas).
* *
* Requirements: * Requirements:
*
* - The divisor cannot be zero. * - The divisor cannot be zero.
*/ */
function mod(uint256 a, uint256 b) internal pure returns (uint256) { function mod(uint256 a, uint256 b) internal pure returns (uint256) {
...@@ -142,6 +149,7 @@ library SafeMath { ...@@ -142,6 +149,7 @@ library SafeMath {
* invalid opcode to revert (consuming all remaining gas). * invalid opcode to revert (consuming all remaining gas).
* *
* Requirements: * Requirements:
*
* - The divisor cannot be zero. * - The divisor cannot be zero.
*/ */
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment