Definitely a useful library when it comes to dealing with math in solidity.

DS-Math provides arithmetic functions for the common numerical primitive types of Solidity. You can safely add, subtract, multiply, and divide uint256 and uint128 numbers without fear of integer overflow. You can also conveniently find the minimum and maximum of two uint256, uint128, or int256 numbers.

This post is deleted!

Your contract should inherit from this type if you want to perform safe arithmetic functions on uint256, uint128, int256 primitive types, or decimal numbers being represented with unsigned integers.

Well, but the amount has to be positive as well as it is bound to the global limits. So I doubt that the amount can be malicious. Or is there a way to manipulate the ETH Amount?

@nicolaortiz What's INT_MAX + 1 in solidity?
An overflow, so yes.

@admin said in DS-Math:

What's INT_MAX + 1 in solidity?
An overflow, so yes.

Got it

Log in to reply

Enjoyed this post? Consider registering for more interesting content!