ERC1155: subtraction overflow issue resolved

Signed-off-by: Rajat Sharma <connecttorajat@outlook.com>
This commit is contained in:
Rajat Sharma 2022-06-16 20:00:14 +05:30 committed by Dave Enyeart
parent fc2494aebd
commit dc015eb3eb

View file

@ -1151,9 +1151,9 @@ func sub(b uint64, q uint64) (uint64, error) {
// Check overflow
var diff uint64
diff = q - b
diff = b - q
if diff > q {
if diff > b {
return 0, fmt.Errorf("Math: subtraction overflow occurred %d - %d", b, q)
}