From d9c57dd1fba8c284a95b2e2ae038c1eaa655323d Mon Sep 17 00:00:00 2001 From: hrkrshnn Date: Thu, 8 Apr 2021 17:34:13 +0200 Subject: [PATCH] Added index for safemath in docs --- docs/control-structures.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/control-structures.rst b/docs/control-structures.rst index e446b58ea..f9d52148f 100644 --- a/docs/control-structures.rst +++ b/docs/control-structures.rst @@ -478,6 +478,7 @@ In any case, you will get a warning about the outer variable being shadowed. } +.. index:: ! safe math, safemath, checked, unchecked .. _unchecked: Checked or Unchecked Arithmetic @@ -501,11 +502,11 @@ To obtain the previous behaviour, an ``unchecked`` block can be used: pragma solidity ^0.8.0; contract C { function f(uint a, uint b) pure public returns (uint) { - // This addition will wrap on underflow. + // This subtraction will wrap on underflow. unchecked { return a - b; } } function g(uint a, uint b) pure public returns (uint) { - // This addition will revert on underflow. + // This subtraction will revert on underflow. return a - b; } }