Vectorized / solady

Optimized Solidity snippets.
MIT License
2.6k stars 346 forks source link

⚡️ Optimize StringStorage #1141

Closed Vectorized closed 3 weeks ago

Vectorized commented 3 weeks ago

Description

Even smaller bytecode size.

Checklist

Ensure you completed all of the steps below before submitting your pull request:

Pull requests with an incomplete checklist will be thrown out.

github-actions[bot] commented 3 weeks ago

Gas Snapshot Comparison Report

Generated at commit : 14869a1cd3b780a632ac2b8ad2bd0f50e692e6ee, Compared to commit : fdfff3ddd35436956d9462882d7f6c3f9deb9f70

Contract Name Test Name Main Gas PR Gas Diff
LibStringTest testSetAndGetStringStorage() 1339534 2307182 967648
testSimpleStringSetAndGetGas() 645418 631496 -13922
testStringEscapeJSONHexEncode() 694182 693036 -1146
testStringPackAndUnpackOne() 719464 718551 -913
testStringPackAndUnpackTwo() 4333549 873353 -3460196
testToStringPositiveNumberBrutalized() 571066 569951 -1115
testToStringUint256MaxBrutalized() 582432 581257 -1175
testToStringZeroBrutalized() 570575 569366 -1209
test__codesize() 50208 50153 -55