Uniswap / v4-core

🦄 🦄 🦄 🦄 Core smart contracts of Uniswap v4
https://blog.uniswap.org/uniswap-v4
2.03k stars 979 forks source link

Spearbit gas-05 #825

Closed hensha256 closed 3 months ago

hensha256 commented 3 months ago

given we know the returndatasize is 32, we can use scratch space instead of using the free memory pointer

github-actions[bot] commented 3 months ago
Forge code coverage: File % Lines % Statements % Branches % Funcs
src/ERC6909.sol 91.30% (21/23) 85.71% (24/28) 100.00% (2/2) 85.71% (6/7)
src/ERC6909Claims.sol 100.00% (6/6) 100.00% (8/8) 100.00% (2/2) 100.00% (1/1)
src/Extsload.sol 100.00% (28/28) 93.33% (28/30) 0.00% (0/2) 100.00% (3/3)
src/Exttload.sol 13.33% (2/15) 12.50% (2/16) 0.00% (0/1) 50.00% (1/2)
src/NoDelegateCall.sol 100.00% (3/3) 100.00% (4/4) 100.00% (1/1) 100.00% (3/3)
src/PoolManager.sol 100.00% (94/94) 98.46% (128/130) 89.47% (17/19) 100.00% (20/20)
src/ProtocolFees.sol 100.00% (23/23) 96.67% (29/30) 80.00% (4/5) 100.00% (6/6)
src/libraries/BitMath.sol 100.00% (11/11) 100.00% (11/11) 100.00% (4/4) 100.00% (2/2)
src/libraries/CurrencyDelta.sol 100.00% (9/9) 100.00% (11/11) 100.00% (0/0) 100.00% (3/3)
src/libraries/CurrencyReserves.sol 85.71% (6/7) 85.71% (6/7) 0.00% (0/1) 100.00% (5/5)
src/libraries/CustomRevert.sol 100.00% (35/35) 100.00% (35/35) 100.00% (0/0) 100.00% (8/8)
src/libraries/FullMath.sol 100.00% (29/29) 100.00% (33/33) 100.00% (6/6) 100.00% (2/2)
src/libraries/Hooks.sol 100.00% (85/85) 98.57% (138/140) 88.00% (22/25) 100.00% (14/14)
src/libraries/LPFeeLibrary.sol 100.00% (10/10) 100.00% (16/16) 100.00% (1/1) 100.00% (7/7)
src/libraries/LiquidityMath.sol 100.00% (4/4) 100.00% (4/4) 100.00% (1/1) 100.00% (1/1)
src/libraries/Lock.sol 100.00% (3/3) 100.00% (3/3) 100.00% (0/0) 100.00% (3/3)
src/libraries/NonzeroDeltaCount.sol 100.00% (7/7) 100.00% (7/7) 100.00% (0/0) 100.00% (3/3)
src/libraries/ParseBytes.sol 100.00% (3/3) 100.00% (3/3) 100.00% (0/0) 100.00% (3/3)
src/libraries/Pool.sol 99.35% (154/155) 99.42% (171/172) 98.04% (50/51) 100.00% (13/13)
src/libraries/Position.sol 100.00% (19/19) 100.00% (21/21) 100.00% (3/3) 100.00% (3/3)
src/libraries/ProtocolFeeLibrary.sol 100.00% (10/10) 100.00% (10/10) 100.00% (0/0) 100.00% (4/4)
src/libraries/SafeCast.sol 100.00% (10/10) 100.00% (16/16) 100.00% (5/5) 100.00% (5/5)
src/libraries/SqrtPriceMath.sol 100.00% (49/49) 100.00% (64/64) 100.00% (12/12) 100.00% (9/9)
src/libraries/StateLibrary.sol 100.00% (63/63) 100.00% (87/87) 100.00% (4/4) 100.00% (14/14)
src/libraries/SwapMath.sol 100.00% (26/26) 100.00% (27/27) 100.00% (6/6) 100.00% (2/2)
src/libraries/TickBitmap.sol 100.00% (30/30) 100.00% (36/36) 100.00% (3/3) 100.00% (4/4)
src/libraries/TickMath.sol 100.00% (120/120) 100.00% (166/166) 100.00% (24/24) 100.00% (4/4)
src/libraries/TransientStateLibrary.sol 100.00% (10/10) 100.00% (13/13) 100.00% (0/0) 100.00% (5/5)
src/libraries/UnsafeMath.sol 100.00% (1/1) 100.00% (1/1) 100.00% (0/0) 100.00% (1/1)
src/types/BalanceDelta.sol 100.00% (2/2) 100.00% (2/2) 100.00% (0/0) 100.00% (2/2)
src/types/BeforeSwapDelta.sol 100.00% (2/2) 100.00% (2/2) 100.00% (0/0) 100.00% (2/2)
src/types/Currency.sol 100.00% (23/23) 96.88% (31/32) 100.00% (8/8) 100.00% (7/7)
src/types/PoolId.sol 100.00% (1/1) 100.00% (1/1) 100.00% (0/0) 100.00% (1/1)
src/types/Slot0.sol 100.00% (8/8) 100.00% (8/8) 100.00% (0/0) 100.00% (8/8)
Total 84.66% (1672/1975) 83.76% (2130/2543) 51.72% (331/640) 81.40% (385/473)