ERC1155: resolving the Subtraction Overflow issue

Signed-off-by: Rajat Sharma <connecttorajat@outlook.com>
This commit is contained in:
Rajat Sharma 2022-06-16 19:27:52 +05:30
parent da80eae525
commit a8dfdc480a

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)
}