From cc059bdca7d0cb39ebf35199968148f9455530f6 Mon Sep 17 00:00:00 2001 From: Shuhui Luo <107524008+shuhuiluo@users.noreply.github.com> Date: Sun, 1 Sep 2024 00:41:28 -0400 Subject: [PATCH 1/4] Remove PancakeSwap dependencies and related code Removed all references and dependencies on PancakeSwap from the project. This includes deleting PancakeSwap-specific import statements, contracts, and updating package.json and remappings.txt to exclude PancakeSwap modules. --- .github/workflows/foundry.yml | 8 - contracts/EphemeralPoolPositions.sol | 11 +- contracts/EphemeralPoolSlots.sol | 82 ----- contracts/EphemeralPoolTickBitmap.sol | 9 - contracts/EphemeralPoolTicks.sol | 17 +- contracts/PositionUtils.sol | 68 ++-- package.json | 1 - remappings.txt | 1 - test/foundry/Base.t.sol | 22 +- yarn.lock | 453 ++++++++++---------------- 10 files changed, 222 insertions(+), 450 deletions(-) diff --git a/.github/workflows/foundry.yml b/.github/workflows/foundry.yml index 3df6198..476dcc7 100644 --- a/.github/workflows/foundry.yml +++ b/.github/workflows/foundry.yml @@ -9,7 +9,6 @@ on: env: FOUNDRY_PROFILE: ci MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} - BNB_RPC_URL: ${{ secrets.BNB_RPC_URL }} jobs: check: @@ -48,10 +47,3 @@ jobs: env: CHAIN_ID: 1 id: testMainnet - - - name: Run Forge tests on BNB mainnet - run: | - forge test -vvv - env: - CHAIN_ID: 56 - id: testBNB diff --git a/contracts/EphemeralPoolPositions.sol b/contracts/EphemeralPoolPositions.sol index da9a7b7..15ff4a8 100644 --- a/contracts/EphemeralPoolPositions.sol +++ b/contracts/EphemeralPoolPositions.sol @@ -30,7 +30,7 @@ contract EphemeralPoolPositions is PoolUtils { unchecked { uint256 POSITIONS_SLOT = getPositionsSlot(); uint256 length = keys.length; - // each position occupies 4 storage slots + // each position occupies 4 storage slots slots = new Slot[](length << 2); uint256 j; for (uint256 i; i < length; ++i) { @@ -56,12 +56,3 @@ contract EphemeralPoolPositions is PoolUtils { } } } - -contract EphemeralPCSV3PoolPositions is EphemeralPoolPositions { - constructor(V3PoolCallee pool, PositionKey[] memory keys) payable EphemeralPoolPositions(pool, keys) {} - - function getPositionsSlot() internal pure override returns (uint256) { - // Storage slot of the `positions` mapping in PancakeSwapV3Pool. - return 8; - } -} diff --git a/contracts/EphemeralPoolSlots.sol b/contracts/EphemeralPoolSlots.sol index 1395b8f..1f3c6e2 100644 --- a/contracts/EphemeralPoolSlots.sol +++ b/contracts/EphemeralPoolSlots.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "@pancakeswap/v3-core/contracts/interfaces/IPancakeV3Pool.sol"; import "./PoolUtils.sol"; /// @notice A lens for fetching static state variables in a Uniswap v3 pool without deployment @@ -79,84 +78,3 @@ contract EphemeralPoolSlots is PoolUtils { } } } - -/// @notice A lens for fetching static state variables in a PancakeSwap v3 pool without deployment -/// @author Aperture Finance -/// @dev The return data can be accessed externally by `eth_call` without a `to` address or internally by catching the -/// revert data, and decoded by `abi.decode(data, (Slot[]))` -contract EphemeralPCSV3PoolSlots is PoolUtils { - constructor(V3PoolCallee pool) payable { - Slot[] memory slots = getSlots(pool); - bytes memory returnData = abi.encode(slots); - assembly ("memory-safe") { - revert(add(returnData, 0x20), mload(returnData)) - } - } - - /// @notice Get the static storage slots of a pool - /// @dev Public function to expose the abi for easier decoding using TypeChain - /// @param pool The PancakeSwap v3 pool - /// @return slots An array of storage slots and their raw data - function getSlots(V3PoolCallee pool) public payable returns (Slot[] memory slots) { - unchecked { - uint256 length; - { - ( - uint160 sqrtPriceX96, - int24 tick, - uint16 observationIndex, - uint16 observationCardinality, - uint16 observationCardinalityNext, - uint32 feeProtocol, - bool unlocked - ) = IPancakeV3Pool(V3PoolCallee.unwrap(pool)).slot0(); - // PancakeV3Pool's slot0() fields actually span two storage slots (slot 0 and 1) as a result of their changing `feeProtocol` from uint8 to uint32. - // The first 5 fields are packed into slot 0, and the last 2 fields (`feeProtocol` and `unlocked`) are packed into slot 1. - // See https://evm.storage/eth/19541394/0x6ca298d2983ab03aa1da7679389d955a4efee15c/slot0#map for a visual representation. - uint256 slot0; - uint256 slot1; - assembly { - slot0 := shl(216, observationCardinalityNext) - slot0 := or(shl(200, observationCardinality), slot0) - slot0 := or(shl(184, observationIndex), slot0) - slot0 := or(shl(160, and(0xffffff, tick)), slot0) - slot0 := or(sqrtPriceX96, slot0) - slot1 := shl(32, unlocked) - slot1 := or(feeProtocol, slot1) - } - length = observationCardinality; - slots = new Slot[](length + 6); - slots[0] = Slot(0, slot0); - slots[1] = Slot(1, slot1); - } - slots[2] = Slot(2, pool.feeGrowthGlobal0X128()); - slots[3] = Slot(3, pool.feeGrowthGlobal1X128()); - { - (uint128 token0, uint128 token1) = pool.protocolFees(); - uint256 slot3; - assembly { - slot3 := or(shl(128, token1), token0) - } - slots[4] = Slot(4, slot3); - } - slots[5] = Slot(5, pool.liquidity()); - for (uint256 i; i < length; ++i) { - ( - uint32 blockTimestamp, - int56 tickCumulative, - uint160 secondsPerLiquidityCumulativeX128, - bool initialized - ) = pool.observations(i); - uint256 observation; - assembly { - observation := shl(248, initialized) - observation := or(shl(88, secondsPerLiquidityCumulativeX128), observation) - observation := or(shl(32, and(0xffffffffffffff, tickCumulative)), observation) - observation := or(blockTimestamp, observation) - } - // PancakeSwapV3Pool's `observations` struct array starts at slot 9. - slots[i + 6] = Slot(i + 9, observation); - } - } - } -} diff --git a/contracts/EphemeralPoolTickBitmap.sol b/contracts/EphemeralPoolTickBitmap.sol index 637f91b..ddec888 100644 --- a/contracts/EphemeralPoolTickBitmap.sol +++ b/contracts/EphemeralPoolTickBitmap.sol @@ -47,12 +47,3 @@ contract EphemeralPoolTickBitmap is PoolUtils { } } } - -contract EphemeralPCSV3PoolTickBitmap is EphemeralPoolTickBitmap { - constructor(V3PoolCallee pool) payable EphemeralPoolTickBitmap(pool) {} - - function getTickBitmapSlot() internal pure override returns (uint256) { - // Storage slot of the `tickBitmap` mapping in PancakeSwapV3Pool. - return 7; - } -} diff --git a/contracts/EphemeralPoolTicks.sol b/contracts/EphemeralPoolTicks.sol index 42ac349..d52bf97 100644 --- a/contracts/EphemeralPoolTicks.sol +++ b/contracts/EphemeralPoolTicks.sol @@ -38,9 +38,9 @@ contract EphemeralPoolTicks is PoolUtils { (int16 wordPosLower, int16 wordPosUpper) = getWordPositions(tickLower, tickUpper, tickSpacing); unchecked { (uint256[] memory tickBitmap, uint256 count) = getTickBitmapAndCount(pool, wordPosLower, wordPosUpper); - // each tick occupies 4 storage slots + // each tick occupies 4 storage slots slots = new Slot[](count << 2); - // fetch populated tick data + // fetch populated tick data uint256 idx; for (int16 wordPos = wordPosLower; wordPos <= wordPosUpper; ++wordPos) { idx = populateTicksInWord( @@ -113,16 +113,3 @@ contract EphemeralPoolTicks is PoolUtils { } } } - -contract EphemeralPCSV3PoolTicks is EphemeralPoolTicks { - constructor( - V3PoolCallee pool, - int24 tickLower, - int24 tickUpper - ) payable EphemeralPoolTicks(pool, tickLower, tickUpper) {} - - function getTicksSlot() internal pure override returns (uint256) { - // Storage slot of the `ticks` mapping in PancakeSwapV3Pool. - return 6; - } -} diff --git a/contracts/PositionUtils.sol b/contracts/PositionUtils.sol index 416397d..7b830f0 100644 --- a/contracts/PositionUtils.sol +++ b/contracts/PositionUtils.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {INonfungiblePositionManager as INPM, IPCSV3NonfungiblePositionManager as IPCSV3NPM} from "@aperture_finance/uni-v3-lib/src/interfaces/INonfungiblePositionManager.sol"; +import {INonfungiblePositionManager as INPM} from "@aperture_finance/uni-v3-lib/src/interfaces/INonfungiblePositionManager.sol"; import {NPMCaller, PositionFull} from "@aperture_finance/uni-v3-lib/src/NPMCaller.sol"; import {PoolAddress} from "@aperture_finance/uni-v3-lib/src/PoolAddress.sol"; import {PoolAddressPancakeSwapV3} from "@aperture_finance/uni-v3-lib/src/PoolAddressPancakeSwapV3.sol"; @@ -10,35 +10,35 @@ import {IUniswapV3Factory} from "@uniswap/v3-core/contracts/interfaces/IUniswapV import {ERC20Callee} from "./libraries/ERC20Caller.sol"; import {PoolUtils} from "./PoolUtils.sol"; -struct Slot0 { - uint160 sqrtPriceX96; - int24 tick; - uint16 observationIndex; - uint16 observationCardinality; - uint16 observationCardinalityNext; - // `feeProtocol` is of type uint8 in Uniswap V3, and uint32 in PancakeSwap V3. - // We use uint32 here as this can hold both uint8 and uint32. - uint32 feeProtocol; - bool unlocked; -} + struct Slot0 { + uint160 sqrtPriceX96; + int24 tick; + uint16 observationIndex; + uint16 observationCardinality; + uint16 observationCardinalityNext; + // `feeProtocol` is of type uint8 in Uniswap V3, and uint32 in PancakeSwap V3. + // We use uint32 here as this can hold both uint8 and uint32. + uint32 feeProtocol; + bool unlocked; + } // The length of the struct is 25 words. -struct PositionState { - // token ID of the position - uint256 tokenId; - // position's owner - address owner; - // nonfungible position manager's position struct with real-time tokensOwed - PositionFull position; - // pool's slot0 struct - Slot0 slot0; - // pool's active liquidity - uint128 activeLiquidity; - // token0's decimals - uint8 decimals0; - // token1's decimals - uint8 decimals1; -} + struct PositionState { + // token ID of the position + uint256 tokenId; + // position's owner + address owner; + // nonfungible position manager's position struct with real-time tokensOwed + PositionFull position; + // pool's slot0 struct + Slot0 slot0; + // pool's active liquidity + uint128 activeLiquidity; + // token0's decimals + uint8 decimals0; + // token1's decimals + uint8 decimals1; + } /// @title Position utility contract /// @author Aperture Finance @@ -86,11 +86,11 @@ abstract contract PositionUtils is PoolUtils { function positionInPlace(INPM npm, uint256 tokenId, PositionFull memory pos) internal view returns (bool exists) { bytes4 selector = INPM.positions.selector; assembly ("memory-safe") { - // Write the abi-encoded calldata into memory. + // Write the abi-encoded calldata into memory. mstore(0, selector) mstore(4, tokenId) - // We use 36 because of the length of our calldata. - // We copy up to 384 bytes of return data at pos's pointer. + // We use 36 because of the length of our calldata. + // We copy up to 384 bytes of return data at pos's pointer. exists := staticcall(gas(), npm, 0, 0x24, pos, 0x180) } } @@ -101,10 +101,10 @@ abstract contract PositionUtils is PoolUtils { function slot0InPlace(V3PoolCallee pool, Slot0 memory slot0) internal view { bytes4 selector = IUniswapV3PoolState.slot0.selector; assembly ("memory-safe") { - // Write the function selector into memory. + // Write the function selector into memory. mstore(0, selector) - // We use 4 because of the length of our calldata. - // We copy up to 224 bytes of return data at slot0's pointer. + // We use 4 because of the length of our calldata. + // We copy up to 224 bytes of return data at slot0's pointer. if iszero(staticcall(gas(), pool, 0, 4, slot0, 0xe0)) { revert(0, 0) } diff --git a/package.json b/package.json index 53b31ca..4ab9eca 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "@ethersproject/providers": "5.7.2", "@nomicfoundation/hardhat-foundry": "^1.1.1", "@nomiclabs/hardhat-ethers": "^2.2.3", - "@pancakeswap/v3-sdk": "^3.8.0", "@typechain/ethers-v5": "^11.1.2", "@typechain/hardhat": "^9.1.0", "@types/chai": "^4.3.14", diff --git a/remappings.txt b/remappings.txt index 02a549a..cbf48a9 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,6 +1,5 @@ @aperture_finance/uni-v3-lib/=node_modules/@aperture_finance/uni-v3-lib/ @openzeppelin/=node_modules/@openzeppelin/ -@pancakeswap/=node_modules/@pancakeswap/ @uniswap/=node_modules/@uniswap/ forge-std/=lib/forge-std/src/ solady/=node_modules/solady/ diff --git a/test/foundry/Base.t.sol b/test/foundry/Base.t.sol index 12a7948..365fc3f 100644 --- a/test/foundry/Base.t.sol +++ b/test/foundry/Base.t.sol @@ -8,8 +8,6 @@ import "@aperture_finance/uni-v3-lib/src/TernaryLib.sol"; import "@aperture_finance/uni-v3-lib/src/TickBitmap.sol"; import "@aperture_finance/uni-v3-lib/src/TickMath.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; -import "@pancakeswap/v3-core/contracts/interfaces/callback/IPancakeV3MintCallback.sol"; -import "@pancakeswap/v3-core/contracts/interfaces/callback/IPancakeV3SwapCallback.sol"; import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol"; import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; import "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol"; @@ -17,17 +15,15 @@ import "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.so import "forge-std/Test.sol"; import "solady/src/utils/SafeTransferLib.sol"; -enum DEX { - UniswapV3, - PancakeSwapV3 -} + enum DEX { + UniswapV3, + PancakeSwapV3 + } abstract contract BaseTest is - Test, - IPancakeV3MintCallback, - IPancakeV3SwapCallback, - IUniswapV3MintCallback, - IUniswapV3SwapCallback +Test, +IUniswapV3MintCallback, +IUniswapV3SwapCallback { using SafeTransferLib for address; using TernaryLib for bool; @@ -101,7 +97,7 @@ abstract contract BaseTest is ***********************************************/ function sqrtPriceX96() internal view returns (uint160 sqrtRatioX96) { - (sqrtRatioX96, ) = V3PoolCallee.wrap(pool).sqrtPriceX96AndTick(); + (sqrtRatioX96,) = V3PoolCallee.wrap(pool).sqrtPriceX96AndTick(); } function currentTick() internal view returns (int24 tick) { @@ -195,7 +191,7 @@ abstract contract BaseTest is // Swap back to the initial price V3PoolCallee.wrap(pool).swap(address(this), false, int256(amountIn), initialPrice, new bytes(0)); } else { - (int256 amount0, ) = V3PoolCallee.wrap(pool).swap( + (int256 amount0,) = V3PoolCallee.wrap(pool).swap( address(this), false, int256(amountIn), diff --git a/yarn.lock b/yarn.lock index 3559237..aa62b50 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8,9 +8,9 @@ integrity sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q== "@aperture_finance/uni-v3-lib@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@aperture_finance/uni-v3-lib/-/uni-v3-lib-2.0.1.tgz#60a6f32a523a08491f884a39610fb224b1636b5f" - integrity sha512-m7R34aVy7WBGAOnA3Jw1uGVLUc1UoicN4nFoecFaTQcRz/INho9FF7KhvL7TbPqi3CUzSTkgntK+NSjo0tiVqA== + version "2.1.0" + resolved "https://registry.yarnpkg.com/@aperture_finance/uni-v3-lib/-/uni-v3-lib-2.1.0.tgz#8890ac7941cfde2cb5870790ad86cf37f70746ea" + integrity sha512-JDTH/O4Fzyh22IC6koWRfb79/HdcMA9CSMjJoVvmjOVHLUQpa9QZdj+z3tQ5X7fsMNam3SQMJj1GUd52eP8Hew== dependencies: "@openzeppelin/contracts" "^5.0.2" "@pancakeswap/v3-core" "^1.0.2" @@ -26,7 +26,7 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.0.12", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.7.0": +"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.5.0", "@ethersproject/abi@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== @@ -429,65 +429,53 @@ resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== -"@nomicfoundation/edr-darwin-arm64@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.3.2.tgz#be1f696d429aecdf47d292a75958551e7cc34294" - integrity sha512-l6wfSBUUbGJiCENT6272CDI8yoMuf0sZH56H5qz3HnAyVzenkOvmzyF6/lar54m986kdAQqWls4cLvDxiOuLxg== - -"@nomicfoundation/edr-darwin-x64@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.3.2.tgz#efd2a5a302dc0a806fb2439a7e2c8ed7bd482ff8" - integrity sha512-OboExL7vEw+TRJQl3KkaEKU4K7PTdZPTInZ0fxMAtOpcWp7EKR+dQo68vc/iAOusB3xszHKxt7t+WpisItfdcg== - -"@nomicfoundation/edr-linux-arm64-gnu@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.3.2.tgz#4d7d4f28e13d426b5e3cf9731dbfed573f819245" - integrity sha512-xtEK+1eg++3pHi6405NDXd80S3CGOFEGQIyVGCwjMGQFOLSzBGGCsrb/0GB4J19zd1o/8ftCd/HjZcbVAWWTLQ== - -"@nomicfoundation/edr-linux-arm64-musl@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.3.2.tgz#10702ae4db386cc21efef9e6276bb56a09581e0a" - integrity sha512-3cIsskJOXQ1yEVsImmCacY7O03tUTiWrmd54F05PnPFrDLkjbzodQ3b2gUWzfbzUZWl67ZTJd1CvVSzpe7XGzw== - -"@nomicfoundation/edr-linux-x64-gnu@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.3.2.tgz#a29590bea8d490aa2129f2cb7fab1559ec9d25ee" - integrity sha512-ouPdphHNsyO7wqwa4hwahC5WqBglK/fIvMmhR/SXNZ9qruIpsA8ZZKIURaHMOv/2h2BbNGcyTX9uEk6+5rK/MQ== - -"@nomicfoundation/edr-linux-x64-musl@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.3.2.tgz#fe2b4c282c80c792b3a03e04d517d140a927cf92" - integrity sha512-sRhwhiPbkpJMOUwXW1FZw9ks6xWyQhIhM0E8o3TXEXKSPKTE6whQLEk1R37iFITaI36vb6rSwLKTU1cb32gCoA== - -"@nomicfoundation/edr-win32-arm64-msvc@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-arm64-msvc/-/edr-win32-arm64-msvc-0.3.2.tgz#6f09cf20f7e7be3ea70f61888cde238d924ec369" - integrity sha512-IEwVealKfumu1HSSnama26yPuQC/uthRPK5IWtFsQUOGwOXaS1r9Bu7cGYH2jBHl3IT/JbxD4xzPq/2pM9uK0A== - -"@nomicfoundation/edr-win32-ia32-msvc@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-ia32-msvc/-/edr-win32-ia32-msvc-0.3.2.tgz#ba4cd9744d95f491329efdfbefb527a8c9f5f31d" - integrity sha512-jYMnf6SFgguqROswwdsjJ1wvneD/5c16pVu9OD4DxNqhKNP5bHEw6L2N4DcJ89tpXMpJ6AlOpc0QuwzddiZ3tA== - -"@nomicfoundation/edr-win32-x64-msvc@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.3.2.tgz#331e3cea1618134e8d9f4ccb999086af6362a3af" - integrity sha512-Byn4QuWczRy/DUUQM3WjglgX/jGVUURVFaUsmIhnGg//MPlCLawubBGRqsrMuvaYedlIIJ4I2rgKvZlxdgHrqg== - -"@nomicfoundation/edr@^0.3.1": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.3.2.tgz#a81500746f8f8c342606a9be04a9f6176f8e2d54" - integrity sha512-HGWtjibAK1mo4I2A7nJ/fXqe/J9G54OrSPJnnkY2K8TiXotYLShGd9GvHkae3PuFjTJKm6ZgBy7tveJj5yrCfw== - optionalDependencies: - "@nomicfoundation/edr-darwin-arm64" "0.3.2" - "@nomicfoundation/edr-darwin-x64" "0.3.2" - "@nomicfoundation/edr-linux-arm64-gnu" "0.3.2" - "@nomicfoundation/edr-linux-arm64-musl" "0.3.2" - "@nomicfoundation/edr-linux-x64-gnu" "0.3.2" - "@nomicfoundation/edr-linux-x64-musl" "0.3.2" - "@nomicfoundation/edr-win32-arm64-msvc" "0.3.2" - "@nomicfoundation/edr-win32-ia32-msvc" "0.3.2" - "@nomicfoundation/edr-win32-x64-msvc" "0.3.2" +"@nomicfoundation/edr-darwin-arm64@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.5.2.tgz#72f7a826c9f0f2c91308edca562de3b9484ac079" + integrity sha512-Gm4wOPKhbDjGTIRyFA2QUAPfCXA1AHxYOKt3yLSGJkQkdy9a5WW+qtqKeEKHc/+4wpJSLtsGQfpzyIzggFfo/A== + +"@nomicfoundation/edr-darwin-x64@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.5.2.tgz#6d0fedb219d664631c6feddc596ab8c3bbc36fa8" + integrity sha512-ClyABq2dFCsrYEED3/UIO0c7p4H1/4vvlswFlqUyBpOkJccr75qIYvahOSJRM62WgUFRhbSS0OJXFRwc/PwmVg== + +"@nomicfoundation/edr-linux-arm64-gnu@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.5.2.tgz#60e4d52d963141bc2bb4a02639dc590a7fbdda2f" + integrity sha512-HWMTVk1iOabfvU2RvrKLDgtFjJZTC42CpHiw2h6rfpsgRqMahvIlx2jdjWYzFNy1jZKPTN1AStQ/91MRrg5KnA== + +"@nomicfoundation/edr-linux-arm64-musl@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.5.2.tgz#6676a09eab57c435a16ffc144658c896acca9baa" + integrity sha512-CwsQ10xFx/QAD5y3/g5alm9+jFVuhc7uYMhrZAu9UVF+KtVjeCvafj0PaVsZ8qyijjqVuVsJ8hD1x5ob7SMcGg== + +"@nomicfoundation/edr-linux-x64-gnu@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.5.2.tgz#f558d9697ce961410e7a7468f9ab8c8a601b9df6" + integrity sha512-CWVCEdhWJ3fmUpzWHCRnC0/VLBDbqtqTGTR6yyY1Ep3S3BOrHEAvt7h5gx85r2vLcztisu2vlDq51auie4IU1A== + +"@nomicfoundation/edr-linux-x64-musl@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.5.2.tgz#c9c9cbb2997499f75c1d022be724b0551d44569f" + integrity sha512-+aJDfwhkddy2pP5u1ISg3IZVAm0dO836tRlDTFWtvvSMQ5hRGqPcWwlsbobhDQsIxhPJyT7phL0orCg5W3WMeA== + +"@nomicfoundation/edr-win32-x64-msvc@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.5.2.tgz#f16db88bf4fe09a996af0a25096e09deecb72bfa" + integrity sha512-CcvvuA3sAv7liFNPsIR/68YlH6rrybKzYttLlMr80d4GKJjwJ5OKb3YgE6FdZZnOfP19HEHhsLcE0DPLtY3r0w== + +"@nomicfoundation/edr@^0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.5.2.tgz#e8c7b3d3dd4a312432ab3930dec60f76dc5c4926" + integrity sha512-hW/iLvUQZNTVjFyX/I40rtKvvDOqUEyIi96T28YaLfmPL+3LW2lxmYLUXEJ6MI14HzqxDqrLyhf6IbjAa2r3Dw== + dependencies: + "@nomicfoundation/edr-darwin-arm64" "0.5.2" + "@nomicfoundation/edr-darwin-x64" "0.5.2" + "@nomicfoundation/edr-linux-arm64-gnu" "0.5.2" + "@nomicfoundation/edr-linux-arm64-musl" "0.5.2" + "@nomicfoundation/edr-linux-x64-gnu" "0.5.2" + "@nomicfoundation/edr-linux-x64-musl" "0.5.2" + "@nomicfoundation/edr-win32-x64-msvc" "0.5.2" "@nomicfoundation/ethereumjs-common@4.0.4": version "4.0.4" @@ -520,9 +508,9 @@ ethereum-cryptography "0.1.3" "@nomicfoundation/hardhat-foundry@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-foundry/-/hardhat-foundry-1.1.1.tgz#db72b1f33f9cfaecc27e67f69ad436f8710162d6" - integrity sha512-cXGCBHAiXas9Pg9MhMOpBVQCkWRYoRFG7GJJAph+sdQsfd22iRs5U5Vs9XmpGEQd1yEvYISQZMeE68Nxj65iUQ== + version "1.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-foundry/-/hardhat-foundry-1.1.2.tgz#4f5aaa1803b8f5d974dcbc361beb72d49c815562" + integrity sha512-f5Vhj3m2qvKGpr6NAINYwNgILDsai8dVCsFb1rAVLkJxOmD2pAtfCmOH5SBVr9yUI5B1z9rbTwPBJVrqnb+PXQ== dependencies: chalk "^2.4.2" @@ -617,36 +605,6 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.0.2.tgz#b1d03075e49290d06570b2fd42154d76c2a5d210" integrity sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA== -"@pancakeswap/chains@0.4.1", "@pancakeswap/chains@^0.4.1": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@pancakeswap/chains/-/chains-0.4.1.tgz#f8dacc6cf7c8f7e8f05665ca0e9b7ff17620212e" - integrity sha512-b7O/oOqtwIkQj1FxGTKbJ1qH7COgD/rkV7JfSpxxIVcH5DZHPhj/P+IdpnlY0hVC1/BHEcvLnjGlSpaywLEOrQ== - -"@pancakeswap/sdk@5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@pancakeswap/sdk/-/sdk-5.8.0.tgz#15c0925d4716de4bbce0789c3dd4c7e1eddd302f" - integrity sha512-gDeeDwq38xMxuvVSASjX4HxRbKfrdNlJQJwwo7dEpExwRJb1QKrMeFEKl1dTW/zReeiIW+bvXseTYQnY8hAmKQ== - dependencies: - "@pancakeswap/chains" "^0.4.1" - "@pancakeswap/swap-sdk-core" "1.1.0" - big.js "^5.2.2" - decimal.js-light "^2.5.0" - tiny-invariant "^1.3.0" - tiny-warning "^1.0.3" - toformat "^2.0.0" - viem "1.19.11" - -"@pancakeswap/swap-sdk-core@1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@pancakeswap/swap-sdk-core/-/swap-sdk-core-1.1.0.tgz#4edc1ef77db9188a1f90153b1983c72326a942e4" - integrity sha512-RBl7M8NoViUeRJuISvkYXCwzeNRjGyMPhZTenJyHVrrkV0Wb37S8RCPirYzVt/63YtU0ZxXHcqCxD64XogtE/Q== - dependencies: - big.js "^5.2.2" - decimal.js-light "^2.5.0" - tiny-invariant "^1.3.0" - tiny-warning "^1.0.3" - toformat "^2.0.0" - "@pancakeswap/v3-core@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@pancakeswap/v3-core/-/v3-core-1.0.2.tgz#f5abf6a98535f33edebbfc11ab40b4fdcee51420" @@ -663,21 +621,6 @@ "@uniswap/v2-core" "1.0.1" base64-sol "1.0.1" -"@pancakeswap/v3-sdk@^3.8.0": - version "3.8.0" - resolved "https://registry.yarnpkg.com/@pancakeswap/v3-sdk/-/v3-sdk-3.8.0.tgz#5a6fc4c25fe7ef463d3bfb8c7c9d63e6f8a4f8af" - integrity sha512-ylGzJiYsSPUa3Qth5BOCC6iww+PvJwR+qn1jplv8LuvDZe9gx6EHusgWHkJquAPaQ9i7kTF5T3QJKGlA/SUMbA== - dependencies: - "@pancakeswap/chains" "0.4.1" - "@pancakeswap/sdk" "5.8.0" - "@pancakeswap/swap-sdk-core" "1.1.0" - big.js "^5.2.2" - decimal.js-light "^2.5.0" - tiny-invariant "^1.3.0" - tiny-warning "^1.0.3" - toformat "^2.0.0" - viem "1.19.11" - "@scure/base@~1.1.0", "@scure/base@~1.1.2": version "1.1.5" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.5.tgz#1d85d17269fe97694b9c592552dd9e5e33552157" @@ -785,10 +728,10 @@ "@sentry/types" "5.30.0" tslib "^1.9.3" -"@solidity-parser/parser@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.17.0.tgz#52a2fcc97ff609f72011014e4c5b485ec52243ef" - integrity sha512-Nko8R0/kUo391jsEHHxrGM07QFdnPGvlmox4rmH0kNiNAashItAilhy4Mv4pK5gQmW5f4sXAF58fwJbmlkGcVw== +"@solidity-parser/parser@^0.18.0": + version "0.18.0" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.18.0.tgz#8e77a02a09ecce957255a2f48c9a7178ec191908" + integrity sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA== "@tsconfig/node10@^1.0.7": version "1.0.9" @@ -840,9 +783,9 @@ "@types/node" "*" "@types/chai@^4.3.14": - version "4.3.14" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.14.tgz#ae3055ea2be43c91c9fd700a36d67820026d96e6" - integrity sha512-Wj71sXE4Q4AkGdG9Tvq1u/fquNz9EdG4LIJMwVVII7ashjD/8cf8fyIfJAjRr6YcsXnSE8cOGQPq1gqeR8z+3w== + version "4.3.19" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.19.tgz#14519f437361d41e84102ed3fbc922ddace3e228" + integrity sha512-2hHHvQBVE2FiSK4eN0Br6snX9MtolHaTo/batnLjlGRhoQzlCL61iVpxoqO7SfFyOw+P/pwv+0zNHzKoGWz9Cw== "@types/lru-cache@^5.1.0": version "5.1.1" @@ -850,9 +793,9 @@ integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== "@types/mocha@^10.0.6": - version "10.0.6" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.6.tgz#818551d39113081048bdddbef96701b4e8bb9d1b" - integrity sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg== + version "10.0.7" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.7.tgz#4c620090f28ca7f905a94b706f74dc5b57b44f2f" + integrity sha512-GN8yJ1mNTcFcah/wKEFIJckJx9iJLoMSzWcfRRuxz/Jk+U6KQNnml+etbtxFK8lPjzOw3zp4Ha/kjSst9fsHYw== "@types/node@*": version "20.10.6" @@ -862,11 +805,11 @@ undici-types "~5.26.4" "@types/node@^20.11.30": - version "20.11.30" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.30.tgz#9c33467fc23167a347e73834f788f4b9f399d66f" - integrity sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw== + version "20.16.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.16.2.tgz#9e388f503a5af306e8c63319334887390966a11e" + integrity sha512-91s/n4qUPV/wg8eE9KHYW1kouTfDk2FPGjXbBMfRWP/2vg1rCXNQL1OCabwGs0XSdukuK+MwCDXE30QpSeMUhQ== dependencies: - undici-types "~5.26.4" + undici-types "~6.19.2" "@types/pbkdf2@^3.0.0": version "3.1.2" @@ -892,19 +835,22 @@ resolved "https://registry.yarnpkg.com/@uniswap/lib/-/lib-4.0.1-alpha.tgz#2881008e55f075344675b3bca93f020b028fbd02" integrity sha512-f6UIliwBbRsgVLxIaBANF6w09tYqc6Y/qXdsrbEmXHyFA7ILiKrIwRFXe1yOg8M3cksgVsO9N7yuL2DdCGQKBA== -"@uniswap/sdk-core@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@uniswap/sdk-core/-/sdk-core-4.2.0.tgz#9930f133baec9c1118d891ebf8fcba7f7efc153d" - integrity sha512-yXAMLHZRYYuh6KpN2nOlLTYBjGiopmI9WUB4Z0tyNkW4ZZub54cUt22eibpGbZAhRAMxclox9IPIs6wwrM3soQ== +"@uniswap/sdk-core@^5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@uniswap/sdk-core/-/sdk-core-5.3.1.tgz#22d753e9ef8666c2f3b4d9a89b9658d169be4ce8" + integrity sha512-XLJY8PcMZnKYBGLABJnLXcr3EgWql3mmnmpHyV1/MmEh9pLJLHYz4HLwVHb8pGDCqpOFX0e+Ei44/qhC7Q5Dsg== dependencies: "@ethersproject/address" "^5.0.2" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "5.7.0" + "@ethersproject/strings" "5.7.0" big.js "^5.2.2" decimal.js-light "^2.5.0" jsbi "^3.1.4" tiny-invariant "^1.1.0" toformat "^2.0.0" -"@uniswap/swap-router-contracts@^1.2.1": +"@uniswap/swap-router-contracts@^1.3.0": version "1.3.1" resolved "https://registry.yarnpkg.com/@uniswap/swap-router-contracts/-/swap-router-contracts-1.3.1.tgz#0ebbb93eb578625618ed9489872de381f9c66fb4" integrity sha512-mh/YNbwKb7Mut96VuEtL+Z5bRe0xVIbjjiryn+iMMrK2sFKhR4duk/86mEz0UO5gSx4pQIw9G5276P5heY/7Rg== @@ -943,14 +889,14 @@ base64-sol "1.0.1" "@uniswap/v3-sdk@^3.11.0": - version "3.11.0" - resolved "https://registry.yarnpkg.com/@uniswap/v3-sdk/-/v3-sdk-3.11.0.tgz#328309fbafddd8c618b7b6850bb99cacf6733a79" - integrity sha512-gz6Q6SlN34AXvxhyz181F90D4OuIkxLnzBAucEzB9Fv3Z+3orHZY/SpGaD02nP1VsNQVu/DQvOsdkPUDGn1Y9Q== + version "3.13.1" + resolved "https://registry.yarnpkg.com/@uniswap/v3-sdk/-/v3-sdk-3.13.1.tgz#67421727b18bb9c449bdf3c92cf3d01530ff3f8f" + integrity sha512-MCc96HrUZy17DINwrGnMtCvr+yXQlWUJJVaIiRRKe1DQzSuv97/G4lzM+zAaSymrxbR2qnHHWL5vMFjmwzCN9Q== dependencies: - "@ethersproject/abi" "^5.0.12" + "@ethersproject/abi" "^5.5.0" "@ethersproject/solidity" "^5.0.9" - "@uniswap/sdk-core" "^4.2.0" - "@uniswap/swap-router-contracts" "^1.2.1" + "@uniswap/sdk-core" "^5.3.1" + "@uniswap/swap-router-contracts" "^1.3.0" "@uniswap/v3-periphery" "^1.1.1" "@uniswap/v3-staker" "1.0.0" tiny-invariant "^1.1.0" @@ -965,11 +911,6 @@ "@uniswap/v3-core" "1.0.0" "@uniswap/v3-periphery" "^1.0.1" -abitype@0.9.8: - version "0.9.8" - resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.9.8.tgz#1f120b6b717459deafd213dfbf3a3dd1bf10ae8c" - integrity sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ== - abitype@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/abitype/-/abitype-1.0.0.tgz#237176dace81d90d018bebf3a45cb42f2a2d9e97" @@ -1022,7 +963,7 @@ ansi-colors@4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-colors@^4.1.1: +ansi-colors@^4.1.1, ansi-colors@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== @@ -1179,7 +1120,7 @@ brorand@^1.1.0: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== -browser-stdout@1.3.1: +browser-stdout@1.3.1, browser-stdout@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== @@ -1380,10 +1321,10 @@ command-line-usage@^6.1.0: table-layout "^1.0.2" typical "^5.2.0" -commander@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" - integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== +commander@^8.1.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== concat-map@0.0.1: version "0.0.1" @@ -1430,6 +1371,13 @@ debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.1: dependencies: ms "2.1.2" +debug@^4.3.5: + version "4.3.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.6.tgz#2ab2c38fbaffebf8aa95fdfe6d88438c7a13c52b" + integrity sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg== + dependencies: + ms "2.1.2" + decamelize@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" @@ -1467,6 +1415,11 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +diff@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531" + integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A== + dotenv@^14.2.0: version "14.3.2" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-14.3.2.tgz#7c30b3a5f777c79a3429cb2db358eef6751e8369" @@ -1508,7 +1461,7 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-string-regexp@4.0.0: +escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== @@ -1636,7 +1589,7 @@ find-replace@^3.0.0: dependencies: array-back "^3.0.1" -find-up@5.0.0: +find-up@5.0.0, find-up@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== @@ -1671,17 +1624,6 @@ fp-ts@^1.0.0: resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== -fs-extra@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - fs-extra@^7.0.0, fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -1752,7 +1694,7 @@ glob@7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" -glob@8.1.0: +glob@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== @@ -1763,19 +1705,7 @@ glob@8.1.0: minimatch "^5.0.1" once "^1.3.0" -glob@^7.1.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -1788,13 +1718,13 @@ hardhat-watcher@^2.1.1: chokidar "^3.5.3" hardhat@^2.22.2: - version "2.22.2" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.2.tgz#0cadd7ec93bf39bab09f81603e75bc5e92acea3d" - integrity sha512-0xZ7MdCZ5sJem4MrvpQWLR3R3zGDoHw5lsR+pBFimqwagimIOn3bWuZv69KA+veXClwI1s/zpqgwPwiFrd4Dxw== + version "2.22.9" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.9.tgz#d8f2720561dc60f5cc0ee80c82f9b1907fd61c88" + integrity sha512-sWiuI/yRdFUPfndIvL+2H18Vs2Gav0XacCFYY5msT5dHOWkhLxESJySIk9j83mXL31aXL8+UMA9OgViFLexklg== dependencies: "@ethersproject/abi" "^5.1.2" "@metamask/eth-sig-util" "^4.0.0" - "@nomicfoundation/edr" "^0.3.1" + "@nomicfoundation/edr" "^0.5.2" "@nomicfoundation/ethereumjs-common" "4.0.4" "@nomicfoundation/ethereumjs-tx" "5.0.4" "@nomicfoundation/ethereumjs-util" "9.0.4" @@ -1828,7 +1758,7 @@ hardhat@^2.22.2: raw-body "^2.4.1" resolve "1.17.0" semver "^6.3.0" - solc "0.7.3" + solc "0.8.26" source-map-support "^0.5.13" stacktrace-parser "^0.1.10" tsort "0.0.1" @@ -1863,7 +1793,7 @@ hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: inherits "^2.0.3" minimalistic-assert "^1.0.1" -he@1.2.0: +he@1.2.0, he@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== @@ -1987,7 +1917,7 @@ js-sha3@0.8.0, js-sha3@^0.8.0: resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== -js-yaml@4.1.0: +js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== @@ -1999,13 +1929,6 @@ jsbi@^3.1.4: resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.2.5.tgz#b37bb90e0e5c2814c1c2a1bcd8c729888a2e37d6" integrity sha512-aBE4n43IPvjaddScbvWRA2YlTzKEynHzu7MqOyTipdHucf/VxS63ViCjxYRg86M8Rxwbt/GfzHl1kKERkt45fQ== -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw== - optionalDependencies: - graceful-fs "^4.1.6" - jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -2031,13 +1954,6 @@ keccak@^3.0.0, keccak@^3.0.2: node-gyp-build "^4.2.0" readable-stream "^3.6.0" -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw== - optionalDependencies: - graceful-fs "^4.1.9" - locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -2063,7 +1979,7 @@ lodash@^4.17.11, lodash@^4.17.15: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@4.1.0: +log-symbols@4.1.0, log-symbols@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== @@ -2126,14 +2042,14 @@ minimatch@5.0.1: dependencies: brace-expansion "^2.0.1" -minimatch@^3.0.4, minimatch@^3.1.1: +minimatch@^3.0.4: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1: +minimatch@^5.0.1, minimatch@^5.1.6: version "5.1.6" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== @@ -2180,37 +2096,37 @@ mocha@^10.0.0: yargs-unparser "2.0.0" mocha@^10.4.0: - version "10.4.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.4.0.tgz#ed03db96ee9cfc6d20c56f8e2af07b961dbae261" - integrity sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA== + version "10.7.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.3.tgz#ae32003cabbd52b59aece17846056a68eb4b0752" + integrity sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A== dependencies: - ansi-colors "4.1.1" - browser-stdout "1.3.1" - chokidar "3.5.3" - debug "4.3.4" - diff "5.0.0" - escape-string-regexp "4.0.0" - find-up "5.0.0" - glob "8.1.0" - he "1.2.0" - js-yaml "4.1.0" - log-symbols "4.1.0" - minimatch "5.0.1" - ms "2.1.3" - serialize-javascript "6.0.0" - strip-json-comments "3.1.1" - supports-color "8.1.1" - workerpool "6.2.1" - yargs "16.2.0" - yargs-parser "20.2.4" - yargs-unparser "2.0.0" + ansi-colors "^4.1.3" + browser-stdout "^1.3.1" + chokidar "^3.5.3" + debug "^4.3.5" + diff "^5.2.0" + escape-string-regexp "^4.0.0" + find-up "^5.0.0" + glob "^8.1.0" + he "^1.2.0" + js-yaml "^4.1.0" + log-symbols "^4.1.0" + minimatch "^5.1.6" + ms "^2.1.3" + serialize-javascript "^6.0.2" + strip-json-comments "^3.1.1" + supports-color "^8.1.1" + workerpool "^6.5.1" + yargs "^16.2.0" + yargs-parser "^20.2.9" + yargs-unparser "^2.0.0" ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3: +ms@2.1.3, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -2334,13 +2250,12 @@ picomatch@^2.0.4, picomatch@^2.2.1: integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== prettier-plugin-solidity@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.3.1.tgz#59944d3155b249f7f234dee29f433524b9a4abcf" - integrity sha512-MN4OP5I2gHAzHZG1wcuJl0FsLS3c4Cc5494bbg+6oQWBPuEamjwDvmGfFMZ6NFzsh3Efd9UUxeT7ImgjNH4ozA== + version "1.4.1" + resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.4.1.tgz#8060baf18853a9e34d2e09e47e87b4f19e15afe9" + integrity sha512-Mq8EtfacVZ/0+uDKTtHZGW3Aa7vEbX/BNx63hmVg6YTiTXSiuKP0amj0G6pGwjmLaOfymWh3QgXEZkjQbU8QRg== dependencies: - "@solidity-parser/parser" "^0.17.0" + "@solidity-parser/parser" "^0.18.0" semver "^7.5.4" - solidity-comments-extractor "^0.0.8" prettier@^2.3.1: version "2.8.8" @@ -2348,9 +2263,9 @@ prettier@^2.3.1: integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== 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== + version "3.3.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105" + integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== randombytes@^2.1.0: version "2.1.0" @@ -2395,11 +2310,6 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== -require-from-string@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - resolve@1.17.0: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" @@ -2407,13 +2317,6 @@ resolve@1.17.0: dependencies: path-parse "^1.0.6" -rimraf@^2.2.8: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -2477,6 +2380,13 @@ serialize-javascript@6.0.0: dependencies: randombytes "^2.1.0" +serialize-javascript@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== + dependencies: + randombytes "^2.1.0" + setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -2500,26 +2410,19 @@ solady@^0.0.180: resolved "https://registry.yarnpkg.com/solady/-/solady-0.0.180.tgz#d806c84a0bf8b6e3d85a8fb0978980de086ff59e" integrity sha512-9QVCyMph+wk78Aq/GxtDAQg7dvNoVWx2dS2Zwf11XlwFKDZ+YJG2lrQsK9NEIth9NOebwjBXAYk4itdwOOE4aw== -solc@0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" - integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== +solc@0.8.26: + version "0.8.26" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.26.tgz#afc78078953f6ab3e727c338a2fefcd80dd5b01a" + integrity sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g== dependencies: command-exists "^1.2.8" - commander "3.0.2" + commander "^8.1.0" follow-redirects "^1.12.1" - fs-extra "^0.30.0" js-sha3 "0.8.0" memorystream "^0.3.1" - require-from-string "^2.0.0" semver "^5.5.0" tmp "0.0.33" -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== - source-map-support@^0.5.13: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -2580,12 +2483,12 @@ strip-hex-prefix@1.0.0: dependencies: is-hex-prefixed "1.0.0" -strip-json-comments@3.1.1: +strip-json-comments@3.1.1, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -supports-color@8.1.1: +supports-color@8.1.1, supports-color@^8.1.1: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== @@ -2616,7 +2519,7 @@ table-layout@^1.0.2: typical "^5.2.0" wordwrapjs "^4.0.0" -tiny-invariant@^1.1.0, tiny-invariant@^1.3.0: +tiny-invariant@^1.1.0: version "1.3.3" resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.3.tgz#46680b7a873a0d5d10005995eb90a70d74d60127" integrity sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg== @@ -2741,9 +2644,9 @@ typechain@^8.3.2: ts-essentials "^7.0.1" 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== + version "5.5.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" + integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== typical@^4.0.0: version "4.0.0" @@ -2760,6 +2663,11 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici-types@~6.19.2: + version "6.19.8" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== + undici@^5.14.0: version "5.28.2" resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.2.tgz#fea200eac65fc7ecaff80a023d1a0543423b4c91" @@ -2797,20 +2705,6 @@ v8-compile-cache-lib@^3.0.1: resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== -viem@1.19.11: - version "1.19.11" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.19.11.tgz#de4ee7537ee036894bd818aa316a8faecaf017e9" - integrity sha512-dbsXEWDBZkByuzJXAs/e01j7dpUJ5ICF5WcyntFwf8Y97n5vnC/91lAleSa6DA5V4WJvYZbhDpYeTctsMAQnhA== - dependencies: - "@adraffy/ens-normalize" "1.10.0" - "@noble/curves" "1.2.0" - "@noble/hashes" "1.3.2" - "@scure/bip32" "1.3.2" - "@scure/bip39" "1.2.1" - abitype "0.9.8" - isows "1.0.3" - ws "8.13.0" - viem@^2.8.4: version "2.9.15" resolved "https://registry.yarnpkg.com/viem/-/viem-2.9.15.tgz#a176f3c3504a6785333ac0f948666854c3a29e30" @@ -2845,6 +2739,11 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== +workerpool@^6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" + integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== + wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -2889,12 +2788,12 @@ yargs-parser@20.2.4: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@^20.2.2: +yargs-parser@^20.2.2, yargs-parser@^20.2.9: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-unparser@2.0.0: +yargs-unparser@2.0.0, yargs-unparser@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== @@ -2904,7 +2803,7 @@ yargs-unparser@2.0.0: flat "^5.0.2" is-plain-obj "^2.1.0" -yargs@16.2.0: +yargs@16.2.0, yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== From 3a914577794818f95741526de6df8cd896fa570a Mon Sep 17 00:00:00 2001 From: Shuhui Luo <107524008+shuhuiluo@users.noreply.github.com> Date: Sun, 1 Sep 2024 01:15:26 -0400 Subject: [PATCH 2/4] Rename interfaces and update dependencies Renamed INonfungiblePositionManager to IUniswapV3NonfungiblePositionManager across multiple files for clarity. Updated package dependencies and fixed Prettier commands for TypeScript files. --- .gas-snapshot | 10 ++-- contracts/EphemeralPoolPositions.sol | 2 +- contracts/EphemeralPoolTicks.sol | 4 +- contracts/PositionUtils.sol | 68 ++++++++++++------------- package.json | 26 +++++----- src/position_lens.rs | 6 +-- src/viem/poolLens.ts | 75 ++++++++-------------------- src/viem/storageLens.ts | 2 +- test/foundry/Base.t.sol | 20 +++----- test/hardhat/univ3_test.ts | 4 +- yarn.lock | 34 ++++++------- 11 files changed, 108 insertions(+), 143 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index b07e9d3..1f6b2be 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,13 +1,13 @@ -PoolLensTest:testFuzz_GetPositions(int24,int24) (runs: 22, μ: 1364083, ~: 1404255) +PoolLensTest:testFuzz_GetPositions(int24,int24) (runs: 16, μ: 1368690, ~: 1404195) PoolLensTest:test_GetPopulatedTicksInRange() (gas: 4544800) -PoolLensTest:test_GetPositions() (gas: 1132120) +PoolLensTest:test_GetPositions() (gas: 1131691) PoolLensTest:test_GetSlots() (gas: 3710586) PoolLensTest:test_GetTickBitmap() (gas: 3399608) -PositionLensTest:testFuzz_GetPosition(uint256) (runs: 22, μ: 270296, ~: 272574) +PositionLensTest:testFuzz_GetPosition(uint256) (runs: 16, μ: 270283, ~: 272574) PositionLensTest:test_AllPositions() (gas: 1140527) PositionLensTest:test_GetFeesOwed() (gas: 2444865) PositionLensTest:test_GetPositions() (gas: 940419) -PositionLensTest:test_GetTotalAmounts() (gas: 2456617) -StorageLensTest:testFuzz_extsload(bytes32) (runs: 22, μ: 33735, ~: 33755) +PositionLensTest:test_GetTotalAmounts() (gas: 2456483) +StorageLensTest:testFuzz_extsload(bytes32) (runs: 16, μ: 33692, ~: 33575) StorageLensTest:test_extsload() (gas: 66705) TickLensTest:test_GetPopulatedTicksInRange() (gas: 11486985) \ No newline at end of file diff --git a/contracts/EphemeralPoolPositions.sol b/contracts/EphemeralPoolPositions.sol index 15ff4a8..6a8eeac 100644 --- a/contracts/EphemeralPoolPositions.sol +++ b/contracts/EphemeralPoolPositions.sol @@ -30,7 +30,7 @@ contract EphemeralPoolPositions is PoolUtils { unchecked { uint256 POSITIONS_SLOT = getPositionsSlot(); uint256 length = keys.length; - // each position occupies 4 storage slots + // each position occupies 4 storage slots slots = new Slot[](length << 2); uint256 j; for (uint256 i; i < length; ++i) { diff --git a/contracts/EphemeralPoolTicks.sol b/contracts/EphemeralPoolTicks.sol index d52bf97..fba16a9 100644 --- a/contracts/EphemeralPoolTicks.sol +++ b/contracts/EphemeralPoolTicks.sol @@ -38,9 +38,9 @@ contract EphemeralPoolTicks is PoolUtils { (int16 wordPosLower, int16 wordPosUpper) = getWordPositions(tickLower, tickUpper, tickSpacing); unchecked { (uint256[] memory tickBitmap, uint256 count) = getTickBitmapAndCount(pool, wordPosLower, wordPosUpper); - // each tick occupies 4 storage slots + // each tick occupies 4 storage slots slots = new Slot[](count << 2); - // fetch populated tick data + // fetch populated tick data uint256 idx; for (int16 wordPos = wordPosLower; wordPos <= wordPosUpper; ++wordPos) { idx = populateTicksInWord( diff --git a/contracts/PositionUtils.sol b/contracts/PositionUtils.sol index 7b830f0..4d3652a 100644 --- a/contracts/PositionUtils.sol +++ b/contracts/PositionUtils.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {INonfungiblePositionManager as INPM} from "@aperture_finance/uni-v3-lib/src/interfaces/INonfungiblePositionManager.sol"; +import {IUniswapV3NonfungiblePositionManager as INPM} from "@aperture_finance/uni-v3-lib/src/interfaces/IUniswapV3NonfungiblePositionManager.sol"; import {NPMCaller, PositionFull} from "@aperture_finance/uni-v3-lib/src/NPMCaller.sol"; import {PoolAddress} from "@aperture_finance/uni-v3-lib/src/PoolAddress.sol"; import {PoolAddressPancakeSwapV3} from "@aperture_finance/uni-v3-lib/src/PoolAddressPancakeSwapV3.sol"; @@ -10,35 +10,35 @@ import {IUniswapV3Factory} from "@uniswap/v3-core/contracts/interfaces/IUniswapV import {ERC20Callee} from "./libraries/ERC20Caller.sol"; import {PoolUtils} from "./PoolUtils.sol"; - struct Slot0 { - uint160 sqrtPriceX96; - int24 tick; - uint16 observationIndex; - uint16 observationCardinality; - uint16 observationCardinalityNext; - // `feeProtocol` is of type uint8 in Uniswap V3, and uint32 in PancakeSwap V3. - // We use uint32 here as this can hold both uint8 and uint32. - uint32 feeProtocol; - bool unlocked; - } +struct Slot0 { + uint160 sqrtPriceX96; + int24 tick; + uint16 observationIndex; + uint16 observationCardinality; + uint16 observationCardinalityNext; + // `feeProtocol` is of type uint8 in Uniswap V3, and uint32 in PancakeSwap V3. + // We use uint32 here as this can hold both uint8 and uint32. + uint32 feeProtocol; + bool unlocked; +} // The length of the struct is 25 words. - struct PositionState { - // token ID of the position - uint256 tokenId; - // position's owner - address owner; - // nonfungible position manager's position struct with real-time tokensOwed - PositionFull position; - // pool's slot0 struct - Slot0 slot0; - // pool's active liquidity - uint128 activeLiquidity; - // token0's decimals - uint8 decimals0; - // token1's decimals - uint8 decimals1; - } +struct PositionState { + // token ID of the position + uint256 tokenId; + // position's owner + address owner; + // nonfungible position manager's position struct with real-time tokensOwed + PositionFull position; + // pool's slot0 struct + Slot0 slot0; + // pool's active liquidity + uint128 activeLiquidity; + // token0's decimals + uint8 decimals0; + // token1's decimals + uint8 decimals1; +} /// @title Position utility contract /// @author Aperture Finance @@ -86,11 +86,11 @@ abstract contract PositionUtils is PoolUtils { function positionInPlace(INPM npm, uint256 tokenId, PositionFull memory pos) internal view returns (bool exists) { bytes4 selector = INPM.positions.selector; assembly ("memory-safe") { - // Write the abi-encoded calldata into memory. + // Write the abi-encoded calldata into memory. mstore(0, selector) mstore(4, tokenId) - // We use 36 because of the length of our calldata. - // We copy up to 384 bytes of return data at pos's pointer. + // We use 36 because of the length of our calldata. + // We copy up to 384 bytes of return data at pos's pointer. exists := staticcall(gas(), npm, 0, 0x24, pos, 0x180) } } @@ -101,10 +101,10 @@ abstract contract PositionUtils is PoolUtils { function slot0InPlace(V3PoolCallee pool, Slot0 memory slot0) internal view { bytes4 selector = IUniswapV3PoolState.slot0.selector; assembly ("memory-safe") { - // Write the function selector into memory. + // Write the function selector into memory. mstore(0, selector) - // We use 4 because of the length of our calldata. - // We copy up to 224 bytes of return data at slot0's pointer. + // We use 4 because of the length of our calldata. + // We copy up to 224 bytes of return data at slot0's pointer. if iszero(staticcall(gas(), pool, 0, 4, slot0, 0xe0)) { revert(0, 0) } diff --git a/package.json b/package.json index 4ab9eca..ba60eea 100644 --- a/package.json +++ b/package.json @@ -42,12 +42,12 @@ "test:hardhat": "hardhat test", "snapshot": "forge snapshot --isolate", "snapshot:diff": "forge snapshot --diff --isolate", - "prettier": "prettier -c contracts/{*,**/*}.sol test/**/*.sol ./**/*.ts", - "prettier:fix": "prettier -w contracts/{*,**/*}.sol test/**/*.sol ./**/*.ts", + "prettier": "prettier -c contracts/{*,**/*}.sol test/**/*.sol {src,test}/**/*.ts", + "prettier:fix": "prettier -w contracts/{*,**/*}.sol test/**/*.sol {src,test}/**/*.ts", "typechain": "hardhat typechain" }, "dependencies": { - "@aperture_finance/uni-v3-lib": "^2.0.1", + "@aperture_finance/uni-v3-lib": "^3.0.3", "@openzeppelin/contracts": "^5.0.2", "ethers": "5.7.2", "viem": "^2.8.4", @@ -56,22 +56,22 @@ "devDependencies": { "@ethersproject/abi": "5.7.0", "@ethersproject/providers": "5.7.2", - "@nomicfoundation/hardhat-foundry": "^1.1.1", + "@nomicfoundation/hardhat-foundry": "^1.1.2", "@nomiclabs/hardhat-ethers": "^2.2.3", "@typechain/ethers-v5": "^11.1.2", "@typechain/hardhat": "^9.1.0", - "@types/chai": "^4.3.14", - "@types/mocha": "^10.0.6", - "@types/node": "^20.11.30", - "@uniswap/v3-sdk": "^3.11.0", + "@types/chai": "^4.3.19", + "@types/mocha": "^10.0.7", + "@types/node": "^22.5.1", + "@uniswap/v3-sdk": "^3.13.1", "chai": "^4.4.1", - "hardhat": "^2.22.2", - "mocha": "^10.4.0", - "prettier": "^3.2.5", - "prettier-plugin-solidity": "^1.3.1", + "hardhat": "^2.22.9", + "mocha": "^10.7.3", + "prettier": "^3.3.3", + "prettier-plugin-solidity": "^1.4.1", "ts-node": "^10.9.2", "typechain": "^8.3.2", - "typescript": "^5.4.3" + "typescript": "^5.5.4" }, "prettier": { "plugins": [ diff --git a/src/position_lens.rs b/src/position_lens.rs index c5c610b..9396d93 100644 --- a/src/position_lens.rs +++ b/src/position_lens.rs @@ -128,7 +128,7 @@ mod tests { use crate::{ bindings::{ ephemeralgetposition::EphemeralGetPosition::{PositionFull, Slot0}, - inonfungiblepositionmanager::INonfungiblePositionManager::INonfungiblePositionManagerInstance, + iuniswapv3nonfungiblepositionmanager::IUniswapV3NonfungiblePositionManager, iuniswapv3pool::IUniswapV3Pool::IUniswapV3PoolInstance, }, tests::*, @@ -280,7 +280,7 @@ mod tests { Some(*BLOCK_NUMBER), ) .await?; - let _npm = INonfungiblePositionManagerInstance::new(NPM_ADDRESS, provider); + let _npm = IUniswapV3NonfungiblePositionManager::new(NPM_ADDRESS, provider); Ok(()) // verify_position_details(positions, npm).await } @@ -288,7 +288,7 @@ mod tests { #[tokio::test] async fn test_get_all_positions_by_owner() -> Result<()> { let provider = PROVIDER.clone(); - let npm = INonfungiblePositionManagerInstance::new(NPM_ADDRESS, provider.clone()); + let npm = IUniswapV3NonfungiblePositionManager::new(NPM_ADDRESS, provider.clone()); let total_supply: U256 = npm.totalSupply().block(*BLOCK_NUMBER).call().await?._0; let owner = npm .ownerOf(total_supply - uint!(1_U256)) diff --git a/src/viem/poolLens.ts b/src/viem/poolLens.ts index d0f0a6b..2fdcb63 100644 --- a/src/viem/poolLens.ts +++ b/src/viem/poolLens.ts @@ -2,22 +2,15 @@ import { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype"; import { Address, PublicClient } from "viem"; import { EphemeralGetPopulatedTicksInRange__factory, - EphemeralPCSV3PoolPositions__factory, - EphemeralPCSV3PoolSlots__factory, - EphemeralPCSV3PoolTickBitmap__factory, - EphemeralPCSV3PoolTicks__factory, EphemeralPoolPositions__factory, EphemeralPoolSlots__factory, EphemeralPoolTickBitmap__factory, EphemeralPoolTicks__factory, } from "../../typechain"; import { callEphemeralContract } from "./caller"; -import { z } from 'zod'; +import { z } from "zod"; -export const AutomatedMarketMakerEnum = z.enum([ - 'UNISWAP_V3', - 'PANCAKESWAP_V3', -]); +export const AutomatedMarketMakerEnum = z.enum(["UNISWAP_V3", "PANCAKESWAP_V3"]); export type AutomatedMarketMakerEnum = z.infer; /** @@ -55,17 +48,11 @@ export async function getStaticSlots( blockNumber?: bigint, ) { return await callEphemeralContract( - amm === AutomatedMarketMakerEnum.enum.PANCAKESWAP_V3 - ? { - abi: EphemeralPCSV3PoolSlots__factory.abi, - bytecode: EphemeralPCSV3PoolSlots__factory.bytecode, - args: [pool], - } - : { - abi: EphemeralPoolSlots__factory.abi, - bytecode: EphemeralPoolSlots__factory.bytecode, - args: [pool], - }, + { + abi: EphemeralPoolSlots__factory.abi, + bytecode: EphemeralPoolSlots__factory.bytecode, + args: [pool], + }, publicClient, blockNumber, ); @@ -80,17 +67,11 @@ export async function getTicksSlots( blockNumber?: bigint, ) { return await callEphemeralContract( - amm === AutomatedMarketMakerEnum.enum.PANCAKESWAP_V3 - ? { - abi: EphemeralPCSV3PoolTicks__factory.abi, - bytecode: EphemeralPCSV3PoolTicks__factory.bytecode, - args: [pool, tickLower, tickUpper], - } - : { - abi: EphemeralPoolTicks__factory.abi, - bytecode: EphemeralPoolTicks__factory.bytecode, - args: [pool, tickLower, tickUpper], - }, + { + abi: EphemeralPoolTicks__factory.abi, + bytecode: EphemeralPoolTicks__factory.bytecode, + args: [pool, tickLower, tickUpper], + }, publicClient, blockNumber, ); @@ -103,17 +84,11 @@ export async function getTickBitmapSlots( blockNumber?: bigint, ) { return await callEphemeralContract( - amm === AutomatedMarketMakerEnum.enum.PANCAKESWAP_V3 - ? { - abi: EphemeralPCSV3PoolTickBitmap__factory.abi, - bytecode: EphemeralPCSV3PoolTickBitmap__factory.bytecode, - args: [pool], - } - : { - abi: EphemeralPoolTickBitmap__factory.abi, - bytecode: EphemeralPoolTickBitmap__factory.bytecode, - args: [pool], - }, + { + abi: EphemeralPoolTickBitmap__factory.abi, + bytecode: EphemeralPoolTickBitmap__factory.bytecode, + args: [pool], + }, publicClient, blockNumber, ); @@ -132,17 +107,11 @@ export async function getPositionsSlots( blockNumber?: bigint, ) { return await callEphemeralContract( - amm === AutomatedMarketMakerEnum.enum.PANCAKESWAP_V3 - ? { - abi: EphemeralPCSV3PoolPositions__factory.abi, - bytecode: EphemeralPCSV3PoolPositions__factory.bytecode, - args: [pool, keys], - } - : { - abi: EphemeralPoolPositions__factory.abi, - bytecode: EphemeralPoolPositions__factory.bytecode, - args: [pool, keys], - }, + { + abi: EphemeralPoolPositions__factory.abi, + bytecode: EphemeralPoolPositions__factory.bytecode, + args: [pool, keys], + }, publicClient, blockNumber, ); diff --git a/src/viem/storageLens.ts b/src/viem/storageLens.ts index 0aaf2eb..24ee1c4 100644 --- a/src/viem/storageLens.ts +++ b/src/viem/storageLens.ts @@ -57,7 +57,7 @@ export async function getStorageAt( ): Promise { const overrides = { [address]: { - code: "0x60806040526004361061001e5760003560e01c8063dbd035ff14610023575b600080fd5b610036610031366004610081565b61004c565b60405161004391906100f6565b60405180910390f35b60606020600052816020528160051b6040016040845b81831461007a57803554825260209182019101610062565b5050806000f35b6000806020838503121561009457600080fd5b823567ffffffffffffffff808211156100ac57600080fd5b818501915085601f8301126100c057600080fd5b8135818111156100cf57600080fd5b8660208260051b85010111156100e457600080fd5b60209290920196919550909350505050565b6020808252825182820181905260009190848201906040850190845b8181101561012e57835183529284019291840191600101610112565b5090969550505050505056fea164736f6c6343000816000a" as Hex, + code: "0x60806040526004361061001e5760003560e01c8063dbd035ff14610023575b600080fd5b61003661003136600461007c565b61004c565b60405161004391906100f3565b60405180910390f35b60606020600052816020528160051b6040016040845b803554825260209182019101828210610062575050806000f35b6000806020838503121561008f57600080fd5b823567ffffffffffffffff8111156100a657600080fd5b8301601f810185136100b757600080fd5b803567ffffffffffffffff8111156100ce57600080fd5b8560208260051b84010111156100e357600080fd5b6020919091019590945092505050565b602080825282518282018190526000918401906040840190835b8181101561012b57835183526020938401939092019160010161010d565b50909594505050505056fea164736f6c634300081a000a" as Hex, }, }; const data = await staticCallWithOverrides( diff --git a/test/foundry/Base.t.sol b/test/foundry/Base.t.sol index 365fc3f..a1f7e1d 100644 --- a/test/foundry/Base.t.sol +++ b/test/foundry/Base.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; -import {INonfungiblePositionManager as INPM} from "@aperture_finance/uni-v3-lib/src/interfaces/INonfungiblePositionManager.sol"; +import {IUniswapV3NonfungiblePositionManager as INPM} from "@aperture_finance/uni-v3-lib/src/interfaces/IUniswapV3NonfungiblePositionManager.sol"; import "@aperture_finance/uni-v3-lib/src/LiquidityAmounts.sol"; import "@aperture_finance/uni-v3-lib/src/PoolCaller.sol"; import "@aperture_finance/uni-v3-lib/src/TernaryLib.sol"; @@ -15,16 +15,12 @@ import "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.so import "forge-std/Test.sol"; import "solady/src/utils/SafeTransferLib.sol"; - enum DEX { - UniswapV3, - PancakeSwapV3 - } +enum DEX { + UniswapV3, + PancakeSwapV3 +} -abstract contract BaseTest is -Test, -IUniswapV3MintCallback, -IUniswapV3SwapCallback -{ +abstract contract BaseTest is Test, IUniswapV3MintCallback, IUniswapV3SwapCallback { using SafeTransferLib for address; using TernaryLib for bool; using TickMath for int24; @@ -97,7 +93,7 @@ IUniswapV3SwapCallback ***********************************************/ function sqrtPriceX96() internal view returns (uint160 sqrtRatioX96) { - (sqrtRatioX96,) = V3PoolCallee.wrap(pool).sqrtPriceX96AndTick(); + (sqrtRatioX96, ) = V3PoolCallee.wrap(pool).sqrtPriceX96AndTick(); } function currentTick() internal view returns (int24 tick) { @@ -191,7 +187,7 @@ IUniswapV3SwapCallback // Swap back to the initial price V3PoolCallee.wrap(pool).swap(address(this), false, int256(amountIn), initialPrice, new bytes(0)); } else { - (int256 amount0,) = V3PoolCallee.wrap(pool).swap( + (int256 amount0, ) = V3PoolCallee.wrap(pool).swap( address(this), false, int256(amountIn), diff --git a/test/hardhat/univ3_test.ts b/test/hardhat/univ3_test.ts index 2d75346..c17c0bd 100644 --- a/test/hardhat/univ3_test.ts +++ b/test/hardhat/univ3_test.ts @@ -16,7 +16,7 @@ import { import { EphemeralGetPositions__factory, EphemeralPoolSlots__factory, - INonfungiblePositionManager__factory, + IUniswapV3NonfungiblePositionManager__factory, IUniswapV3Pool__factory, } from "../../typechain"; import { mainnet } from "viem/chains"; @@ -50,7 +50,7 @@ describe("Pool lens test with UniV3 on mainnet", () => { }); const npm = getContract({ address: UNIV3_NPM, - abi: INonfungiblePositionManager__factory.abi, + abi: IUniswapV3NonfungiblePositionManager__factory.abi, client: publicClient, }); diff --git a/yarn.lock b/yarn.lock index aa62b50..3cc38c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7" integrity sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q== -"@aperture_finance/uni-v3-lib@^2.0.1": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@aperture_finance/uni-v3-lib/-/uni-v3-lib-2.1.0.tgz#8890ac7941cfde2cb5870790ad86cf37f70746ea" - integrity sha512-JDTH/O4Fzyh22IC6koWRfb79/HdcMA9CSMjJoVvmjOVHLUQpa9QZdj+z3tQ5X7fsMNam3SQMJj1GUd52eP8Hew== +"@aperture_finance/uni-v3-lib@^3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@aperture_finance/uni-v3-lib/-/uni-v3-lib-3.0.3.tgz#96cd879c25983ffdceeb6c1f235bcb3ce7f3678a" + integrity sha512-vl+ZlE2/Rp52qQZ09n1yDv9z6YLlRJrfHrZc6Bu3tb6EsWrD5dDgYp0dBbOrm0gBzSiSFA0DLEOrafzQARkqCg== dependencies: "@openzeppelin/contracts" "^5.0.2" "@pancakeswap/v3-core" "^1.0.2" @@ -507,7 +507,7 @@ "@nomicfoundation/ethereumjs-rlp" "5.0.4" ethereum-cryptography "0.1.3" -"@nomicfoundation/hardhat-foundry@^1.1.1": +"@nomicfoundation/hardhat-foundry@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-foundry/-/hardhat-foundry-1.1.2.tgz#4f5aaa1803b8f5d974dcbc361beb72d49c815562" integrity sha512-f5Vhj3m2qvKGpr6NAINYwNgILDsai8dVCsFb1rAVLkJxOmD2pAtfCmOH5SBVr9yUI5B1z9rbTwPBJVrqnb+PXQ== @@ -782,7 +782,7 @@ dependencies: "@types/node" "*" -"@types/chai@^4.3.14": +"@types/chai@^4.3.19": version "4.3.19" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.19.tgz#14519f437361d41e84102ed3fbc922ddace3e228" integrity sha512-2hHHvQBVE2FiSK4eN0Br6snX9MtolHaTo/batnLjlGRhoQzlCL61iVpxoqO7SfFyOw+P/pwv+0zNHzKoGWz9Cw== @@ -792,7 +792,7 @@ resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== -"@types/mocha@^10.0.6": +"@types/mocha@^10.0.7": version "10.0.7" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.7.tgz#4c620090f28ca7f905a94b706f74dc5b57b44f2f" integrity sha512-GN8yJ1mNTcFcah/wKEFIJckJx9iJLoMSzWcfRRuxz/Jk+U6KQNnml+etbtxFK8lPjzOw3zp4Ha/kjSst9fsHYw== @@ -804,10 +804,10 @@ dependencies: undici-types "~5.26.4" -"@types/node@^20.11.30": - version "20.16.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.16.2.tgz#9e388f503a5af306e8c63319334887390966a11e" - integrity sha512-91s/n4qUPV/wg8eE9KHYW1kouTfDk2FPGjXbBMfRWP/2vg1rCXNQL1OCabwGs0XSdukuK+MwCDXE30QpSeMUhQ== +"@types/node@^22.5.1": + version "22.5.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.1.tgz#de01dce265f6b99ed32b295962045d10b5b99560" + integrity sha512-KkHsxej0j9IW1KKOOAA/XBA0z08UFSrRQHErzEfA3Vgq57eXIMYboIlHJuYIfd+lwCQjtKqUu3UnmKbtUc9yRw== dependencies: undici-types "~6.19.2" @@ -888,7 +888,7 @@ "@uniswap/v3-core" "^1.0.0" base64-sol "1.0.1" -"@uniswap/v3-sdk@^3.11.0": +"@uniswap/v3-sdk@^3.13.1": version "3.13.1" resolved "https://registry.yarnpkg.com/@uniswap/v3-sdk/-/v3-sdk-3.13.1.tgz#67421727b18bb9c449bdf3c92cf3d01530ff3f8f" integrity sha512-MCc96HrUZy17DINwrGnMtCvr+yXQlWUJJVaIiRRKe1DQzSuv97/G4lzM+zAaSymrxbR2qnHHWL5vMFjmwzCN9Q== @@ -1717,7 +1717,7 @@ hardhat-watcher@^2.1.1: dependencies: chokidar "^3.5.3" -hardhat@^2.22.2: +hardhat@^2.22.9: version "2.22.9" resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.9.tgz#d8f2720561dc60f5cc0ee80c82f9b1907fd61c88" integrity sha512-sWiuI/yRdFUPfndIvL+2H18Vs2Gav0XacCFYY5msT5dHOWkhLxESJySIk9j83mXL31aXL8+UMA9OgViFLexklg== @@ -2095,7 +2095,7 @@ mocha@^10.0.0: yargs-parser "20.2.4" yargs-unparser "2.0.0" -mocha@^10.4.0: +mocha@^10.7.3: version "10.7.3" resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.3.tgz#ae32003cabbd52b59aece17846056a68eb4b0752" integrity sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A== @@ -2249,7 +2249,7 @@ picomatch@^2.0.4, picomatch@^2.2.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -prettier-plugin-solidity@^1.3.1: +prettier-plugin-solidity@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.4.1.tgz#8060baf18853a9e34d2e09e47e87b4f19e15afe9" integrity sha512-Mq8EtfacVZ/0+uDKTtHZGW3Aa7vEbX/BNx63hmVg6YTiTXSiuKP0amj0G6pGwjmLaOfymWh3QgXEZkjQbU8QRg== @@ -2262,7 +2262,7 @@ prettier@^2.3.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== -prettier@^3.2.5: +prettier@^3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105" integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== @@ -2643,7 +2643,7 @@ typechain@^8.3.2: ts-command-line-args "^2.2.0" ts-essentials "^7.0.1" -typescript@^5.4.3: +typescript@^5.5.4: version "5.5.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== From a40d25b8cfd177c6c995ffb29390b21e5e2aa50d Mon Sep 17 00:00:00 2001 From: Shuhui Luo <107524008+shuhuiluo@users.noreply.github.com> Date: Sun, 1 Sep 2024 01:37:03 -0400 Subject: [PATCH 3/4] Update RPC URL environment variable Replaced INFURA_API_KEY with MAINNET_RPC_URL for consistency and clarity. Updated the test setup to use the new MAINNET_RPC_URL for fetching the RPC URL from the environment variables. --- .github/workflows/rust.yml | 2 +- src/tests.rs | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6c7f336..e82bd29 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -8,7 +8,7 @@ on: env: CARGO_TERM_COLOR: always - INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }} + MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} jobs: lint: diff --git a/src/tests.rs b/src/tests.rs index fe1c56a..44b2c28 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -9,12 +9,7 @@ use once_cell::sync::Lazy; pub(crate) static BLOCK_NUMBER: Lazy = Lazy::new(|| BlockId::from(17000000)); pub(crate) static RPC_URL: Lazy = Lazy::new(|| { dotenv().ok(); - format!( - "https://mainnet.infura.io/v3/{}", - std::env::var("INFURA_API_KEY").unwrap() - ) - .parse() - .unwrap() + std::env::var("MAINNET_RPC_URL").unwrap().parse().unwrap() }); pub(crate) static PROVIDER: Lazy = Lazy::new(|| ProviderBuilder::new().on_http(RPC_URL.clone())); From 794b733cf80874ac0c9a586330e1d9aaae02f59f Mon Sep 17 00:00:00 2001 From: Shuhui Luo <107524008+shuhuiluo@users.noreply.github.com> Date: Sun, 1 Sep 2024 01:38:18 -0400 Subject: [PATCH 4/4] Update gas snapshot values in tests Adjusted gas usage metrics in multiple test cases to reflect new performance measurements. These changes help ensure the accuracy and relevance of benchmarking data in our testing suite. --- .gas-snapshot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 1f6b2be..998d983 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,13 +1,13 @@ -PoolLensTest:testFuzz_GetPositions(int24,int24) (runs: 16, μ: 1368690, ~: 1404195) +PoolLensTest:testFuzz_GetPositions(int24,int24) (runs: 16, μ: 1377904, ~: 1405347) PoolLensTest:test_GetPopulatedTicksInRange() (gas: 4544800) -PoolLensTest:test_GetPositions() (gas: 1131691) +PoolLensTest:test_GetPositions() (gas: 1131631) PoolLensTest:test_GetSlots() (gas: 3710586) PoolLensTest:test_GetTickBitmap() (gas: 3399608) -PositionLensTest:testFuzz_GetPosition(uint256) (runs: 16, μ: 270283, ~: 272574) +PositionLensTest:testFuzz_GetPosition(uint256) (runs: 16, μ: 269758, ~: 272641) PositionLensTest:test_AllPositions() (gas: 1140527) PositionLensTest:test_GetFeesOwed() (gas: 2444865) PositionLensTest:test_GetPositions() (gas: 940419) -PositionLensTest:test_GetTotalAmounts() (gas: 2456483) +PositionLensTest:test_GetTotalAmounts() (gas: 2456469) StorageLensTest:testFuzz_extsload(bytes32) (runs: 16, μ: 33692, ~: 33575) StorageLensTest:test_extsload() (gas: 66705) TickLensTest:test_GetPopulatedTicksInRange() (gas: 11486985) \ No newline at end of file