Skip to content

feat(UIntMath): add safe32#42

Merged
PierrickGT merged 2 commits intomainfrom
feat/add-safe32
May 15, 2025
Merged

feat(UIntMath): add safe32#42
PierrickGT merged 2 commits intomainfrom
feat/add-safe32

Conversation

@PierrickGT
Copy link
Copy Markdown
Member

No description provided.

@PierrickGT PierrickGT requested a review from toninorair May 2, 2025 20:45
@github-actions
Copy link
Copy Markdown

github-actions bot commented May 2, 2025

Changes to gas cost

Generated at commit: f200a804551c628ec9a360ed76a030411bdac41d, compared to commit: a3d5c2cb9b752250c50117bc0728cecec44860ec

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
ERC20ExtendedHarness allowance
authorizationState
balanceOf
nonces
totalSupply
+466 ❌
+1,000 ❌
+388 ❌
+2,000 ❌
+1,999 ❌
+17.52%
+46.32%
+15.78%
+230.41%
+386.65%
SignatureCheckerHarness isValidERC1271Signature +2,222 ❌ +55.61%
ERC20ExtendedHandler transfer +8,317 ❌ +15.13%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
ERC20ExtendedHarness 2,825,334 (-12) allowance
approve
authorizationState
balanceOf
burn
mint
nonces
totalSupply
transfer
transferFrom
3,126 (+2,000)
26,852 (0)
3,159 (+2,000)
2,847 (+2,000)
24,522 (0)
29,060 (0)
2,868 (+2,000)
2,516 (+2,000)
24,523 (0)
25,385 (0)
+177.62%
0.00%
+172.56%
+236.13%
0.00%
0.00%
+230.41%
+387.60%
0.00%
0.00%
3,126 (+466)
46,614 (-8)
3,159 (+1,000)
2,847 (+388)
29,386 (+1)
65,006 (+61)
2,868 (+2,000)
2,516 (+1,999)
31,453 (+7)
34,049 (-2)
+17.52%
-0.02%
+46.32%
+15.78%
+0.00%
+0.09%
+230.41%
+386.65%
+0.02%
-0.01%
3,126 (0)
46,848 (-12)
3,159 (+1,000)
2,847 (0)
29,310 (0)
69,112 (0)
2,868 (+2,000)
2,516 (+2,000)
29,589 (0)
32,789 (0)
0.00%
-0.03%
+46.32%
0.00%
0.00%
0.00%
+230.41%
+387.60%
0.00%
0.00%
3,126 (0)
47,148 (0)
3,159 (0)
2,847 (0)
35,282 (0)
69,472 (0)
2,868 (+2,000)
2,516 (0)
47,873 (0)
53,873 (0)
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
+230.41%
0.00%
0.00%
0.00%
3,308 (-6)
2,313 (+53)
3,094 (0)
7,929 (-37)
1,826 (-25)
4,871 (-32)
257 (0)
1,030 (0)
1,772 (-5)
2,050 (-1)
SignatureCheckerHarness 985,562 (0) isValidERC1271Signature
isValidSignature
5,255 (+2,494)
5,743 (+2,500)
+90.33%
+77.09%
6,218 (+2,222)
6,201 (+70)
+55.61%
+1.14%
6,331 (+1,961)
6,170 (+41)
+44.87%
+0.67%
6,884 (+1,629)
10,448 (0)
+31.00%
0.00%
9 (0)
532 (0)
ERC20ExtendedHandler 1,370,312 (0) approve
burn
mint
transfer
transferFrom
32,893 (0)
48,291 (+4,500)
679 (0)
780 (0)
886 (0)
0.00%
+10.28%
0.00%
0.00%
0.00%
52,560 (-10)
50,532 (+4,499)
73,893 (+1,785)
63,304 (+8,317)
63,838 (+8,336)
-0.02%
+9.77%
+2.48%
+15.13%
+15.02%
52,877 (0)
50,619 (+4,500)
69,239 (+1,988)
63,796 (+8,500)
64,256 (+8,500)
0.00%
+9.76%
+2.96%
+15.37%
+15.24%
53,189 (0)
50,815 (+4,500)
103,691 (+2,000)
63,992 (+8,500)
64,452 (+8,500)
0.00%
+9.72%
+1.97%
+15.32%
+15.19%
1,284 (+53)
1,313 (-25)
1,279 (-28)
1,266 (-2)
1,283 (+2)
UIntMathHarness 915,217 (+31,894) bound128
bound240
bound32
max240
min112
min240
min256
min32
min40
safe240
safe40
safe48
773 (-22)
773 (-22)
751 (-22)
954 (-22)
888 (-22)
977 (+89)
946 (+89)
954 (-22)
932 (-22)
555 (-22)
510 (-22)
599 (+88)
-2.77%
-2.77%
-2.85%
-2.25%
-2.42%
+10.02%
+10.39%
-2.25%
-2.31%
-3.81%
-4.14%
+17.22%
773 (-22)
773 (-22)
751 (-22)
959 (-22)
893 (-22)
982 (+89)
951 (+89)
959 (-22)
937 (-22)
647 (-22)
602 (-22)
691 (+88)
-2.77%
-2.77%
-2.85%
-2.24%
-2.40%
+9.97%
+10.32%
-2.24%
-2.29%
-3.29%
-3.53%
+14.59%
773 (-22)
773 (-22)
751 (-22)
959 (-22)
893 (-22)
982 (+89)
951 (+89)
959 (-22)
937 (-22)
647 (-22)
602 (-22)
691 (+88)
-2.77%
-2.77%
-2.85%
-2.24%
-2.40%
+9.97%
+10.32%
-2.24%
-2.29%
-3.29%
-3.53%
+14.59%
773 (-22)
773 (-22)
751 (-22)
964 (-22)
898 (-22)
987 (+89)
956 (+89)
964 (-22)
942 (-22)
740 (-22)
695 (-22)
784 (+88)
-2.77%
-2.77%
-2.85%
-2.23%
-2.39%
+9.91%
+10.27%
-2.23%
-2.28%
-2.89%
-3.07%
+12.64%
1 (0)
1 (0)
1 (0)
2 (0)
2 (0)
2 (0)
2 (0)
2 (0)
2 (0)
2 (0)
2 (0)
2 (0)

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 2, 2025

LCOV of commit 60fe138 during Forge Coverage #134

Summary coverage rate:
  lines......: 86.3% (246 of 285 lines)
  functions..: 87.3% (69 of 79 functions)
  branches...: no data found

Files changed coverage rate:
                                     |Lines       |Functions  |Branches    
  Filename                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================
  src/ERC20Extended.sol              |31.2%     32| 0.0%    10|    -      0
  src/libs/UIntMath.sol              |42.6%     47| 0.0%    20|    -      0

@PierrickGT PierrickGT requested a review from 0xIryna May 14, 2025 17:14
Co-authored-by: Michael De Luca <michael.deluca@circle-free.com>
@PierrickGT PierrickGT requested a review from 0xIryna May 14, 2025 22:27
@PierrickGT PierrickGT merged commit d7ee458 into main May 15, 2025
2 checks passed
@PierrickGT PierrickGT deleted the feat/add-safe32 branch May 15, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants