Skip to content

Commit

Permalink
Update package dependencies and adjust test configuration
Browse files Browse the repository at this point in the history
This commit includes updates to the package dependencies including `@openzeppelin/contracts`, `solady`, `prettier` and `typescript`. It also adjusts the `forge snapshot` and `forge snapshot:diff` commands in the test configuration to use the `cancun` EVM version and to isolate execution. Furthermore, the package version has been incremented.
  • Loading branch information
shuhuiluo committed Mar 23, 2024
1 parent 37a1abe commit 7842c56
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 69 deletions.
88 changes: 44 additions & 44 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,59 @@ FullMathTest:testFuzz_MulDiv96(uint256,uint256) (runs: 65536, μ: 3601, ~: 3585)
FullMathTest:testFuzz_MulDivUp_OZ(uint256,uint256,uint256) (runs: 65536, μ: 4391, ~: 4237)
FullMathTest:testFuzz_MulDivUp_Og(uint256,uint256,uint256) (runs: 65536, μ: 9579, ~: 9416)
FullMathTest:testFuzz_MulDiv_OZ(uint256,uint256,uint256) (runs: 65536, μ: 4031, ~: 3914)
FullMathTest:testFuzz_MulDiv_Og(uint256,uint256,uint256) (runs: 65536, μ: 9463, ~: 9326)
FullMathTest:testFuzz_MulDiv_Og(uint256,uint256,uint256) (runs: 65536, μ: 9464, ~: 9326)
FullMathTest:testFuzz_Sqrt(uint256) (runs: 65536, μ: 1651, ~: 1661)
LiquidityAmountsTest:testFuzz_GetAmount0ForLiquidity(uint160,uint160,uint128) (runs: 65536, μ: 17067, ~: 17121)
LiquidityAmountsTest:testFuzz_GetAmount1ForLiquidity(uint160,uint160,uint128) (runs: 65536, μ: 16510, ~: 16543)
LiquidityAmountsTest:testFuzz_GetAmountsForLiquidity(uint160,uint160,uint160,uint128) (runs: 65536, μ: 18689, ~: 18593)
LiquidityAmountsTest:testFuzz_GetLiquidityForAmount0(uint160,uint160,uint256) (runs: 65536, μ: 18611, ~: 19288)
LiquidityAmountsTest:testFuzz_GetLiquidityForAmount1(uint160,uint160,uint256) (runs: 65536, μ: 18389, ~: 19240)
LiquidityAmountsTest:testFuzz_GetLiquidityForAmounts(uint160,uint160,uint160,uint256,uint256) (runs: 65536, μ: 20254, ~: 20620)
LiquidityAmountsTest:testFuzz_GetAmount0ForLiquidity(uint160,uint160,uint128) (runs: 65536, μ: 17075, ~: 17121)
LiquidityAmountsTest:testFuzz_GetAmount1ForLiquidity(uint160,uint160,uint128) (runs: 65536, μ: 16513, ~: 16543)
LiquidityAmountsTest:testFuzz_GetAmountsForLiquidity(uint160,uint160,uint160,uint128) (runs: 65536, μ: 18704, ~: 18540)
LiquidityAmountsTest:testFuzz_GetLiquidityForAmount0(uint160,uint160,uint256) (runs: 65536, μ: 18602, ~: 19288)
LiquidityAmountsTest:testFuzz_GetLiquidityForAmount1(uint160,uint160,uint256) (runs: 65536, μ: 18390, ~: 19240)
LiquidityAmountsTest:testFuzz_GetLiquidityForAmounts(uint160,uint160,uint160,uint256,uint256) (runs: 65536, μ: 20252, ~: 20564)
LiquidityAmountsTest:testGas_GetAmountsForLiquidity() (gas: 216208)
LiquidityAmountsTest:testGas_GetAmountsForLiquidity_Og() (gas: 231471)
LiquidityAmountsTest:testGas_GetLiquidityForAmounts() (gas: 221029)
LiquidityAmountsTest:testGas_GetLiquidityForAmounts_Og() (gas: 258436)
LiquidityMathTest:testFuzz_AddDelta(uint128,int128) (runs: 65536, μ: 11033, ~: 14938)
LiquidityMathTest:testFuzz_AddDelta(uint128,int128) (runs: 65536, μ: 11038, ~: 14938)
LiquidityMathTest:testGas_AddDelta() (gas: 113817)
LiquidityMathTest:testGas_AddDelta_Og() (gas: 129492)
LiquidityMathTest:testRevert_LA() (gas: 9042)
LiquidityMathTest:testRevert_LS() (gas: 8876)
NPMCallerTest:testFuzz_BalanceOf(address) (runs: 16, μ: 15142, ~: 15142)
NPMCallerTest:testFuzz_GetApproved(uint256) (runs: 16, μ: 18486, ~: 18512)
NPMCallerTest:testFuzz_IsApprovedForAll(uint256) (runs: 16, μ: 51596, ~: 51607)
NPMCallerTest:testFuzz_GetApproved(uint256) (runs: 16, μ: 18471, ~: 18472)
NPMCallerTest:testFuzz_IsApprovedForAll(uint256) (runs: 16, μ: 75168, ~: 75179)
NPMCallerTest:testFuzz_OwnerOf(uint256) (runs: 16, μ: 20981, ~: 20992)
NPMCallerTest:testFuzz_Positions(uint256) (runs: 16, μ: 35542, ~: 35568)
NPMCallerTest:testFuzz_PositionsFull(uint256) (runs: 16, μ: 36151, ~: 36177)
NPMCallerTest:testFuzz_TokenOfOwnerByIndex(uint256) (runs: 16, μ: 59109, ~: 39776)
NPMCallerTest:testFuzz_Positions(uint256) (runs: 16, μ: 35527, ~: 35528)
NPMCallerTest:testFuzz_PositionsFull(uint256) (runs: 16, μ: 36136, ~: 36137)
NPMCallerTest:testFuzz_TokenOfOwnerByIndex(uint256) (runs: 16, μ: 79122, ~: 42674)
NPMCallerTest:testRevert_GetApproved() (gas: 14216)
NPMCallerTest:testRevert_OwnerOf() (gas: 14407)
NPMCallerTest:testRevert_Positions() (gas: 24241)
NPMCallerTest:test_Approve() (gas: 73011)
NPMCallerTest:test_Burn() (gas: 611858)
NPMCallerTest:test_Collect() (gas: 599278)
NPMCallerTest:test_DecreaseLiquidity() (gas: 564896)
NPMCallerTest:test_Approve() (gas: 126679)
NPMCallerTest:test_Burn() (gas: 907456)
NPMCallerTest:test_Collect() (gas: 850767)
NPMCallerTest:test_DecreaseLiquidity() (gas: 771094)
NPMCallerTest:test_Factory() (gas: 10194)
NPMCallerTest:test_IncreaseLiquidity() (gas: 840075)
NPMCallerTest:test_IncreaseLiquidity() (gas: 1004686)
NPMCallerTest:test_IsApprovedForAll() (gas: 21253)
NPMCallerTest:test_Mint() (gas: 483283)
NPMCallerTest:test_Permit() (gas: 534552)
NPMCallerTest:test_SetApprovalForAll() (gas: 34758)
NPMCallerTest:test_Mint() (gas: 562723)
NPMCallerTest:test_Permit() (gas: 647428)
NPMCallerTest:test_SetApprovalForAll() (gas: 56330)
NPMCallerTest:test_TotalSupply() (gas: 11953)
PoolAddressTest:testFuzz_ComputeAddress(address,address,uint24) (runs: 65536, μ: 12175, ~: 12161)
PoolAddressTest:testFuzz_ComputeAddressCalldata(address,address,uint24) (runs: 65536, μ: 10260, ~: 10247)
PoolAddressTest:testFuzz_ComputeAddressFromKey(address,address,uint24) (runs: 65536, μ: 12465, ~: 12451)
PoolAddressTest:testFuzz_VerifyCallback(address,address,uint24) (runs: 65536, μ: 11510, ~: 11524)
PoolAddressTest:testFuzz_VerifyCallbackCalldata(address,address,uint24) (runs: 65536, μ: 10752, ~: 10766)
PoolAddressTest:testFuzz_VerifyCallback(address,address,uint24) (runs: 65536, μ: 11510, ~: 11497)
PoolAddressTest:testFuzz_VerifyCallbackCalldata(address,address,uint24) (runs: 65536, μ: 10752, ~: 10739)
PoolAddressTest:testGas_ComputeAddress() (gas: 7766)
PoolAddressTest:testGas_ComputeAddress_Og() (gas: 8464)
PoolCallerTest:testFuzz_LiquidityNet(int24) (runs: 16, μ: 18777, ~: 18777)
PoolCallerTest:testFuzz_Observations(uint256) (runs: 16, μ: 18976, ~: 19049)
PoolCallerTest:testFuzz_Observations(uint256) (runs: 16, μ: 18957, ~: 19049)
PoolCallerTest:testFuzz_Positions(bytes32) (runs: 16, μ: 19317, ~: 19317)
PoolCallerTest:testFuzz_Swap(bool,uint256,bytes) (runs: 16, μ: 247341, ~: 231108)
PoolCallerTest:testFuzz_Swap(bool,uint256,bytes) (runs: 16, μ: 283842, ~: 261944)
PoolCallerTest:testFuzz_TickBitmap(int16) (runs: 16, μ: 11022, ~: 11022)
PoolCallerTest:testFuzz_Ticks(int24) (runs: 16, μ: 20800, ~: 20800)
PoolCallerTest:testRevert_AS_Swap() (gas: 13272)
PoolCallerTest:testRevert_SPL_Swap() (gas: 15887)
PoolCallerTest:testRevert_AS_Swap() (gas: 35416)
PoolCallerTest:testRevert_SPL_Swap() (gas: 38043)
PoolCallerTest:test_Fee() (gas: 8713)
PoolCallerTest:test_FeeGrowthGlobal0X128() (gas: 10376)
PoolCallerTest:test_FeeGrowthGlobal1X128() (gas: 10930)
Expand All @@ -69,27 +69,27 @@ PoolCallerTest:test_LiquidityNet() (gas: 22551)
PoolCallerTest:test_ProtocolFees() (gas: 11065)
PoolCallerTest:test_Slot0() (gas: 13447)
PoolCallerTest:test_SqrtPriceX96AndTick() (gas: 9767)
PoolCallerTest:test_Swap() (gas: 305607)
PoolCallerTest:test_Swap() (gas: 340090)
PoolCallerTest:test_TickSpacing() (gas: 8257)
SafeCastTest:testRevert_ToInt128() (gas: 3384)
SafeCastTest:testRevert_ToInt256() (gas: 3032)
SafeCastTest:testRevert_ToUint128() (gas: 3406)
SafeCastTest:testRevert_ToUint160() (gas: 3186)
SafeCastTest:testToInt128() (gas: 555)
SafeCastTest:testToInt128(int256) (runs: 65536, μ: 1476, ~: 496)
SafeCastTest:testToInt128(int256) (runs: 65536, μ: 1475, ~: 496)
SafeCastTest:testToInt128(uint256) (runs: 65536, μ: 1245, ~: 258)
SafeCastTest:testToInt256() (gas: 181)
SafeCastTest:testToInt256(uint256) (runs: 65536, μ: 1182, ~: 686)
SafeCastTest:testToInt256(uint256) (runs: 65536, μ: 1179, ~: 686)
SafeCastTest:testToUint128(uint256) (runs: 65536, μ: 1529, ~: 538)
SafeCastTest:testToUint160(uint256) (runs: 65536, μ: 1192, ~: 318)
SqrtPriceMathTest:testFuzz_GetAmount0Delta(uint160,uint160,int128) (runs: 65536, μ: 12859, ~: 12606)
SafeCastTest:testToUint160(uint256) (runs: 65536, μ: 1191, ~: 318)
SqrtPriceMathTest:testFuzz_GetAmount0Delta(uint160,uint160,int128) (runs: 65536, μ: 12860, ~: 12606)
SqrtPriceMathTest:testFuzz_GetAmount0Delta(uint160,uint160,uint128,bool) (runs: 65536, μ: 12535, ~: 12258)
SqrtPriceMathTest:testFuzz_GetAmount1Delta(uint160,uint160,int128) (runs: 65536, μ: 12507, ~: 12426)
SqrtPriceMathTest:testFuzz_GetAmount1Delta(uint160,uint160,uint128,bool) (runs: 65536, μ: 12535, ~: 12563)
SqrtPriceMathTest:testFuzz_GetNextSqrtPriceFromAmount0RoundingUp(uint160,uint128,uint256,bool) (runs: 65536, μ: 16548, ~: 16401)
SqrtPriceMathTest:testFuzz_GetNextSqrtPriceFromAmount1RoundingDown(uint160,uint128,uint256,bool) (runs: 65536, μ: 19142, ~: 18700)
SqrtPriceMathTest:testFuzz_GetNextSqrtPriceFromInput(uint160,uint128,uint256,bool) (runs: 65536, μ: 13307, ~: 12857)
SqrtPriceMathTest:testFuzz_GetNextSqrtPriceFromOutput(uint160,uint128,uint256,bool) (runs: 65536, μ: 14064, ~: 14705)
SqrtPriceMathTest:testFuzz_GetNextSqrtPriceFromAmount0RoundingUp(uint160,uint128,uint256,bool) (runs: 65536, μ: 16547, ~: 16401)
SqrtPriceMathTest:testFuzz_GetNextSqrtPriceFromAmount1RoundingDown(uint160,uint128,uint256,bool) (runs: 65536, μ: 19151, ~: 18700)
SqrtPriceMathTest:testFuzz_GetNextSqrtPriceFromInput(uint160,uint128,uint256,bool) (runs: 65536, μ: 13309, ~: 12857)
SqrtPriceMathTest:testFuzz_GetNextSqrtPriceFromOutput(uint160,uint128,uint256,bool) (runs: 65536, μ: 14061, ~: 14705)
SqrtPriceMathTest:testGas_GetAmount0Delta() (gas: 256572)
SqrtPriceMathTest:testGas_GetAmount0Delta_Og() (gas: 280254)
SqrtPriceMathTest:testGas_GetAmount1Delta() (gas: 209212)
Expand All @@ -98,21 +98,21 @@ SqrtPriceMathTest:testGas_GetNextSqrtPriceFromInput() (gas: 227868)
SqrtPriceMathTest:testGas_GetNextSqrtPriceFromInput_Og() (gas: 243885)
SqrtPriceMathTest:testGas_GetNextSqrtPriceFromOutput() (gas: 213109)
SqrtPriceMathTest:testGas_GetNextSqrtPriceFromOutput_Og() (gas: 225117)
SwapMathTest:testFuzz_ComputeSwapStep(uint160,uint160,uint128,int256,uint24) (runs: 65536, μ: 22118, ~: 22228)
SwapMathTest:testFuzz_ComputeSwapStepExactIn(uint160,uint160,uint128,uint256,uint24) (runs: 65536, μ: 23606, ~: 23636)
SwapMathTest:testFuzz_ComputeSwapStepExactOut(uint160,uint160,uint128,uint256,uint24) (runs: 65536, μ: 22951, ~: 22846)
SwapMathTest:testFuzz_ComputeSwapStep(uint160,uint160,uint128,int256,uint24) (runs: 65536, μ: 22131, ~: 22231)
SwapMathTest:testFuzz_ComputeSwapStepExactIn(uint160,uint160,uint128,uint256,uint24) (runs: 65536, μ: 23616, ~: 23636)
SwapMathTest:testFuzz_ComputeSwapStepExactOut(uint160,uint160,uint128,uint256,uint24) (runs: 65536, μ: 22959, ~: 22846)
SwapMathTest:testGas_ComputeSwapStep() (gas: 384720)
SwapMathTest:testGas_ComputeSwapStepExactIn() (gas: 394759)
SwapMathTest:testGas_ComputeSwapStepExactIn_Og() (gas: 515722)
SwapMathTest:testGas_ComputeSwapStepExactOut() (gas: 370755)
SwapMathTest:testGas_ComputeSwapStepExactOut_Og() (gas: 510266)
SwapMathTest:testGas_ComputeSwapStep_Og() (gas: 526558)
TickBitmapTest:testFuzz_Compress(int24,int24) (runs: 65536, μ: 8348, ~: 8382)
TickBitmapTest:testFuzz_FlipTick(int24) (runs: 65536, μ: 61570, ~: 61576)
TickBitmapTest:testFuzz_NextInitializedTickWithinOneWord(int24,uint8,bool) (runs: 65536, μ: 67880, ~: 67868)
TickBitmapTest:testFuzz_Compress(int24,int24) (runs: 65536, μ: 8348, ~: 8393)
TickBitmapTest:testFuzz_FlipTick(int24) (runs: 65536, μ: 108389, ~: 108698)
TickBitmapTest:testFuzz_NextInitializedTickWithinOneWord(int24,uint8,bool) (runs: 65536, μ: 110546, ~: 110490)
TickBitmapTest:testFuzz_Position(int24) (runs: 65536, μ: 498, ~: 498)
TickBitmapTest:testGas_NextInitializedTickWithinOneWord() (gas: 6769095)
TickBitmapTest:testGas_NextInitializedTickWithinOneWord_Og() (gas: 7050256)
TickBitmapTest:testGas_NextInitializedTickWithinOneWord() (gas: 12246459)
TickBitmapTest:testGas_NextInitializedTickWithinOneWord_Og() (gas: 12527620)
TickBitmapTest:test_NextInitializedTickWithinOneWord_GT() (gas: 203148)
TickBitmapTest:test_NextInitializedTickWithinOneWord_LTE() (gas: 204586)
TickBitmapTest:test_NextInitializedTick_GT() (gas: 342054)
Expand Down
1 change: 0 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ sparse_mode = true

verbosity = 2
ffi = false
fs_permissions = [{ access = "read", path = "./out" }]

[fuzz]
runs = 65536
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aperture_finance/uni-v3-lib",
"description": "A suite of Solidity libraries that have been imported and rewritten from Uniswap's v3-core and v3-periphery",
"version": "1.2.1",
"version": "1.2.2",
"author": "Aperture Finance",
"homepage": "https://aperture.finance/",
"license": "GPL-2.0-or-later",
Expand All @@ -26,21 +26,21 @@
"build": "forge build",
"clean": "forge clean",
"test": "forge test",
"snapshot": "forge snapshot --via-ir --evm-version shanghai",
"snapshot:diff": "forge snapshot --diff --via-ir --evm-version shanghai",
"snapshot": "forge snapshot --via-ir --evm-version cancun --isolate",
"snapshot:diff": "forge snapshot --diff --via-ir --evm-version cancun --isolate",
"prettier": "prettier -c {src,test}/**/*.sol",
"prettier:fix": "prettier -w {src,test}/**/*.sol"
},
"dependencies": {
"@openzeppelin/contracts": "^5.0.1",
"@openzeppelin/contracts": "^5.0.2",
"@uniswap/v3-core": "^1.0.1",
"@uniswap/v3-periphery": "^1.4.4",
"solady": "^0.0.155"
"solady": "^0.0.180"
},
"devDependencies": {
"prettier": "^3.1.1",
"prettier": "^3.2.5",
"prettier-plugin-solidity": "^1.3.1",
"typescript": "^5.3.3"
"typescript": "^5.4.3"
},
"prettier": {
"plugins": [
Expand Down
32 changes: 16 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.2-solc-0.7.tgz#38f4dbab672631034076ccdf2f3201fab1726635"
integrity sha512-W6QmqgkADuFcTLzHL8vVoNBtkwjvQRpYIAom7KiUNoLKghyx3FgH0GBjt8NRvigV1ZmMOBllvE1By1C+bi8WpA==

"@openzeppelin/contracts@^5.0.1":
version "5.0.1"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.0.1.tgz#93da90fc209a0a4ff09c1deb037fbb35e4020890"
integrity sha512-yQJaT5HDp9hYOOp4jTYxMsR02gdFZFXhewX5HW9Jo4fsqSVqqyIO/xTHdWDaKX5a3pv1txmf076Lziz+sO7L1w==
"@openzeppelin/contracts@^5.0.2":
version "5.0.2"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.0.2.tgz#b1d03075e49290d06570b2fd42154d76c2a5d210"
integrity sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA==

"@solidity-parser/parser@^0.17.0":
version "0.17.0"
Expand Down Expand Up @@ -64,10 +64,10 @@ prettier-plugin-solidity@^1.3.1:
semver "^7.5.4"
solidity-comments-extractor "^0.0.8"

prettier@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848"
integrity sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==
prettier@^3.2.5:
version "3.2.5"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368"
integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==

semver@^7.5.4:
version "7.5.4"
Expand All @@ -76,20 +76,20 @@ semver@^7.5.4:
dependencies:
lru-cache "^6.0.0"

solady@^0.0.155:
version "0.0.155"
resolved "https://registry.yarnpkg.com/solady/-/solady-0.0.155.tgz#855cd63190902c4167e8501d74d72272a0285067"
integrity sha512-UVFZxRNe+Iv3B2Z0dfo2Pngg4lyeHE1QqpI5wDS5bdhsCUfgEzhFZxQN7DJ6lKy3hSyF39ldGLKlCCEJp7EM4Q==
solady@^0.0.180:
version "0.0.180"
resolved "https://registry.yarnpkg.com/solady/-/solady-0.0.180.tgz#d806c84a0bf8b6e3d85a8fb0978980de086ff59e"
integrity sha512-9QVCyMph+wk78Aq/GxtDAQg7dvNoVWx2dS2Zwf11XlwFKDZ+YJG2lrQsK9NEIth9NOebwjBXAYk4itdwOOE4aw==

solidity-comments-extractor@^0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.8.tgz#f6e148ab0c49f30c1abcbecb8b8df01ed8e879f8"
integrity sha512-htM7Vn6LhHreR+EglVMd2s+sZhcXAirB1Zlyrv5zBuTxieCvjfnRpd7iZk75m/u6NOlEyQ94C6TWbBn2cY7w8g==

typescript@^5.3.3:
version "5.3.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37"
integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==
typescript@^5.4.3:
version "5.4.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.3.tgz#5c6fedd4c87bee01cd7a528a30145521f8e0feff"
integrity sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==

yallist@^4.0.0:
version "4.0.0"
Expand Down

0 comments on commit 7842c56

Please sign in to comment.