Closed Rubilmax closed 1 year ago
What does safeAbs protect from?
What does safeAbs protect from?
It protects from reverting in the case we've reached the negative bound (which doesn't have an exact positive opposite) I'll add a comment about it
EDIT: it's the other way around. Instead, safeAbs does revert in the case we've reach the negative bound
Nice! what's the gas imrpovement?
It is less than 10 gas lol
Nice! what's the gas imrpovement?
It is less than 10 gas lol
lol ok thx
Changes to gas cost
๐งพ Summary (20% most significant diffs)
Full diff report ๐
| Contract | Deployment Cost (+/-) | Method | Min (+/-) | % | Avg (+/-) | % | Median (+/-) | % | Max (+/-) | % | # Calls (+/-) | |:-|-:|:-|-:|-:|-:|-:|-:|-:|-:|-:|-:| | **MathRef contract** | 238,081 (+37,836) | _divUp_
_log2Dichotomy_
_log2Naive_
_max_
_min_
_zeroFloorSub_ | 573 (-26)
4,741 (-54)
44,490 (-538)
386 (+73)
398 (+53)
363 (-79) | **-4.34%**
**-1.13%**
**-1.19%**
**+23.32%**
**+15.36%**
**-17.87%** | 573 (-26)
4,741 (-54)
44,490 (-538)
386 (+73)
398 (+53)
363 (-79) | **-4.34%**
**-1.13%**
**-1.19%**
**+23.32%**
**+15.36%**
**-17.87%** | 573 (-26)
4,741 (-54)
44,490 (-538)
386 (+73)
398 (+53)
363 (-79) | **-4.34%**
**-1.13%**
**-1.19%**
**+23.32%**
**+15.36%**
**-17.87%** | 573 (-26)
4,741 (-54)
44,490 (-538)
386 (+73)
398 (+53)
363 (-79) | **-4.34%**
**-1.13%**
**-1.19%**
**+23.32%**
**+15.36%**
**-17.87%** | 1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0) | | **MathMock contract** | 138,183 (+34,630) | _divUp_
_log2_ | 350 (+12)
567 (+91) | **+3.55%**
**+19.12%** | 432 (+12)
567 (+91) | **+2.86%**
**+19.12%** | 453 (+12)
567 (+91) | **+2.72%**
**+19.12%** | 453 (+12)
567 (+91) | **+2.72%**
**+19.12%** | 5 (0)
2 (0) |