From b203f005039d3a6fd34720892b1af5c294c53a25 Mon Sep 17 00:00:00 2001 From: arcantheon Date: Tue, 19 Mar 2024 15:42:23 +0530 Subject: [PATCH 1/9] Updated openzeppelin version --- package-lock.json | 19 +++++++++++-------- package.json | 4 ++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1b76aee2..a2583559 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,8 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@openzeppelin/contracts": "^4.7.3", - "@openzeppelin/contracts-upgradeable": "^4.7.3", + "@openzeppelin/contracts": "^5.0.2", + "@openzeppelin/contracts-upgradeable": "^5.0.2", "@uniswap/v3-core": "^1.0.0", "@uniswap/v3-periphery": "^1.3.0" }, @@ -57,14 +57,17 @@ } }, "node_modules/@openzeppelin/contracts": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.3.tgz", - "integrity": "sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==" + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-5.0.2.tgz", + "integrity": "sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA==" }, "node_modules/@openzeppelin/contracts-upgradeable": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.3.tgz", - "integrity": "sha512-jjaHAVRMrE4UuZNfDwjlLGDxTHWIOwTJS2ldnc278a0gevfXfPr8hxKEVBGFBE96kl2G3VHDZhUimw/+G3TG2A==" + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-5.0.2.tgz", + "integrity": "sha512-0MmkHSHiW2NRFiT9/r5Lu4eJq5UJ4/tzlOgYXNAIj/ONkQTVnz22pLxDvp4C4uZ9he7ZFvGn3Driptn1/iU7tQ==", + "peerDependencies": { + "@openzeppelin/contracts": "5.0.2" + } }, "node_modules/@uniswap/lib": { "version": "4.0.1-alpha", diff --git a/package.json b/package.json index d845c727..3f5d3b6d 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ "forge-coverage": "forge coverage --report lcov && lcov --remove ./lcov.info -o ./lcov.info 'test/*' && rm -rf ./coverage && genhtml lcov.info --output-dir coverage && mv lcov.info ./coverage" }, "dependencies": { - "@openzeppelin/contracts": "^4.7.3", - "@openzeppelin/contracts-upgradeable": "^4.7.3", + "@openzeppelin/contracts": "^5.0.2", + "@openzeppelin/contracts-upgradeable": "^5.0.2", "@uniswap/v3-core": "^1.0.0", "@uniswap/v3-periphery": "^1.3.0" }, From bb9ad6eb0f3bfaef30ae752b1f23164942aa1073 Mon Sep 17 00:00:00 2001 From: arcantheon Date: Tue, 19 Mar 2024 15:43:05 +0530 Subject: [PATCH 2/9] Upgraded version and fixed ReentrancyGuard path --- contracts/Farm.sol | 4 ++-- contracts/FarmDeployer.sol | 5 +++-- contracts/FarmRegistry.sol | 2 +- contracts/FarmStorage.sol | 2 +- contracts/e20-farms/E20Farm.sol | 2 +- contracts/e20-farms/balancerV2/BalancerV2Farm.sol | 2 +- contracts/e20-farms/balancerV2/BalancerV2FarmDeployer.sol | 5 ++--- .../e20-farms/balancerV2/interfaces/IBalancerV2Vault.sol | 2 +- contracts/e20-farms/uniswapV2/UniV2Farm.sol | 2 +- contracts/e20-farms/uniswapV2/UniV2FarmDeployer.sol | 5 ++--- .../e20-farms/uniswapV2/interfaces/IUniswapV2Factory.sol | 2 +- contracts/e721-farms/E721Farm.sol | 2 +- contracts/e721-farms/camelotV2/CamelotV2Farm.sol | 2 +- contracts/e721-farms/camelotV2/CamelotV2FarmDeployer.sol | 5 ++--- contracts/e721-farms/camelotV2/interfaces/ICamelotV2.sol | 2 +- .../e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol | 5 ++--- contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityFarm.sol | 2 +- contracts/e721-farms/uniswapV3/UniV3Farm.sol | 2 +- contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol | 5 ++--- .../interfaces/INonfungiblePositionManagerUtils.sol | 2 +- contracts/e721-farms/uniswapV3/interfaces/IUniswapV3.sol | 2 +- .../e721-farms/uniswapV3/interfaces/IUniswapV3Utils.sol | 2 +- contracts/e721-farms/uniswapV3/tests/ISwapRouter.sol | 2 +- contracts/e721-farms/uniswapV3/tests/UniswapV3Test.sol | 2 +- contracts/features/ExpirableFarm.sol | 2 +- contracts/features/OperableDeposit.sol | 2 +- contracts/interfaces/DataTypes.sol | 2 +- contracts/interfaces/IFarm.sol | 2 +- contracts/interfaces/IFarmRegistry.sol | 2 +- contracts/interfaces/IOracle.sol | 2 +- contracts/interfaces/IRewarderFactory.sol | 2 +- contracts/rewarder/LegacyFarmRewarder.sol | 2 +- contracts/rewarder/Rewarder.sol | 4 ++-- contracts/rewarder/RewarderFactory.sol | 2 +- contracts/rewarder/interfaces/ILegacyRewarderHelpers.sol | 2 +- contracts/utils/BrownieUtils.sol | 2 +- contracts/utils/TokenUtils.sol | 2 +- test/Farm.t.sol | 2 +- test/FarmRegistry.t.sol | 2 +- test/e20-farms/E20Farm.t.sol | 2 +- test/e20-farms/balancerV2/BalancerV2Farm.t.sol | 2 +- test/e721-farms/E721Farm.t.sol | 2 +- test/e721-farms/camelotV2/CamelotV2Farm.t.sol | 2 +- test/e721-farms/uniswapv3/UniV3ActiveLiquidityFarm.t.sol | 2 +- test/e721-farms/uniswapv3/UniV3Farm.t.sol | 2 +- test/e721-farms/uniswapv3/sushiswap/SushiswapV3Farm.t.sol | 2 +- .../uniswapv3/uniswap/UniswapV3ActiveLiquidityFarm.t.sol | 2 +- test/e721-farms/uniswapv3/uniswap/UniswapV3Farm.t.sol | 2 +- test/features/ExpirableFarm.t.sol | 2 +- test/rewarder/LegacyFarmRewarder.t.sol | 2 +- test/rewarder/Rewarder.t.sol | 2 +- test/utils/BaseSetup.t.sol | 2 +- test/utils/TestNetworkConfig.t.sol | 2 +- test/utils/UpgradeUtil.t.sol | 2 +- test/utils/networkConfig/Arbitrum.t.sol | 2 +- test/utils/networkConfig/INetworkConfig.sol | 2 +- 56 files changed, 65 insertions(+), 69 deletions(-) diff --git a/contracts/Farm.sol b/contracts/Farm.sol index c38252b8..0387ed42 100644 --- a/contracts/Farm.sol +++ b/contracts/Farm.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // @@ -26,7 +26,7 @@ pragma solidity 0.8.16; import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; -import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; +import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import {Multicall} from "@openzeppelin/contracts/utils/Multicall.sol"; import {FarmStorage} from "./FarmStorage.sol"; diff --git a/contracts/FarmDeployer.sol b/contracts/FarmDeployer.sol index 41bbd1cd..156b6f42 100644 --- a/contracts/FarmDeployer.sol +++ b/contracts/FarmDeployer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // @@ -26,12 +26,13 @@ pragma solidity 0.8.16; import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import {IFarmRegistry} from "./interfaces/IFarmRegistry.sol"; /// @title FarmDeployer contract of Demeter Protocol /// @notice Exposes base functionalities which will be useful in every deployer /// @author Sperax Foundation -abstract contract FarmDeployer is Ownable { +abstract contract FarmDeployer is Ownable, ReentrancyGuard { using SafeERC20 for IERC20; address public immutable FARM_REGISTRY; diff --git a/contracts/FarmRegistry.sol b/contracts/FarmRegistry.sol index f14a148e..5cfeab59 100644 --- a/contracts/FarmRegistry.sol +++ b/contracts/FarmRegistry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/FarmStorage.sol b/contracts/FarmStorage.sol index b5b08f15..024427f5 100644 --- a/contracts/FarmStorage.sol +++ b/contracts/FarmStorage.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/e20-farms/E20Farm.sol b/contracts/e20-farms/E20Farm.sol index f2d45571..8efe1449 100644 --- a/contracts/e20-farms/E20Farm.sol +++ b/contracts/e20-farms/E20Farm.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/e20-farms/balancerV2/BalancerV2Farm.sol b/contracts/e20-farms/balancerV2/BalancerV2Farm.sol index 270b7ddf..11f8d43f 100644 --- a/contracts/e20-farms/balancerV2/BalancerV2Farm.sol +++ b/contracts/e20-farms/balancerV2/BalancerV2Farm.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/e20-farms/balancerV2/BalancerV2FarmDeployer.sol b/contracts/e20-farms/balancerV2/BalancerV2FarmDeployer.sol index c3279f5b..851a2237 100644 --- a/contracts/e20-farms/balancerV2/BalancerV2FarmDeployer.sol +++ b/contracts/e20-farms/balancerV2/BalancerV2FarmDeployer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // @@ -27,7 +27,6 @@ pragma solidity 0.8.16; import {FarmDeployer, SafeERC20, IERC20, IFarmRegistry} from "../../FarmDeployer.sol"; import {IBalancerV2Vault} from "./interfaces/IBalancerV2Vault.sol"; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; -import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {RewardTokenData} from "../E20Farm.sol"; import {BalancerV2Farm} from "./BalancerV2Farm.sol"; @@ -35,7 +34,7 @@ import {BalancerV2Farm} from "./BalancerV2Farm.sol"; /// @author Sperax Foundation /// @notice This contract allows anyone to calculate fees and create farms /// @dev It consults Balancer's vault to validate the pool -contract BalancerV2FarmDeployer is FarmDeployer, ReentrancyGuard { +contract BalancerV2FarmDeployer is FarmDeployer { using SafeERC20 for IERC20; // farmAdmin - Address to which ownership of farm is transferred to post deployment diff --git a/contracts/e20-farms/balancerV2/interfaces/IBalancerV2Vault.sol b/contracts/e20-farms/balancerV2/interfaces/IBalancerV2Vault.sol index 8d4cf51f..8f179212 100644 --- a/contracts/e20-farms/balancerV2/interfaces/IBalancerV2Vault.sol +++ b/contracts/e20-farms/balancerV2/interfaces/IBalancerV2Vault.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/contracts/e20-farms/uniswapV2/UniV2Farm.sol b/contracts/e20-farms/uniswapV2/UniV2Farm.sol index 8aa5a16b..d4e330ec 100644 --- a/contracts/e20-farms/uniswapV2/UniV2Farm.sol +++ b/contracts/e20-farms/uniswapV2/UniV2Farm.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/e20-farms/uniswapV2/UniV2FarmDeployer.sol b/contracts/e20-farms/uniswapV2/UniV2FarmDeployer.sol index b047f1d0..2e874132 100644 --- a/contracts/e20-farms/uniswapV2/UniV2FarmDeployer.sol +++ b/contracts/e20-farms/uniswapV2/UniV2FarmDeployer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // @@ -27,11 +27,10 @@ pragma solidity 0.8.16; import {FarmDeployer, SafeERC20, IERC20, IFarmRegistry} from "../../FarmDeployer.sol"; import {IUniswapV2Factory} from "./interfaces/IUniswapV2Factory.sol"; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; -import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {RewardTokenData} from "../E20Farm.sol"; import {UniV2Farm} from "./UniV2Farm.sol"; -contract UniV2FarmDeployer is FarmDeployer, ReentrancyGuard { +contract UniV2FarmDeployer is FarmDeployer { using SafeERC20 for IERC20; // @dev the token Order is not important diff --git a/contracts/e20-farms/uniswapV2/interfaces/IUniswapV2Factory.sol b/contracts/e20-farms/uniswapV2/interfaces/IUniswapV2Factory.sol index 8c5931b7..6501507c 100644 --- a/contracts/e20-farms/uniswapV2/interfaces/IUniswapV2Factory.sol +++ b/contracts/e20-farms/uniswapV2/interfaces/IUniswapV2Factory.sol @@ -1,4 +1,4 @@ -pragma solidity 0.8.16; +pragma solidity 0.8.24; interface IUniswapV2Factory { function getPair(address _tokenA, address _tokenB) external view returns (address); diff --git a/contracts/e721-farms/E721Farm.sol b/contracts/e721-farms/E721Farm.sol index 39755224..f93800e3 100644 --- a/contracts/e721-farms/E721Farm.sol +++ b/contracts/e721-farms/E721Farm.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/e721-farms/camelotV2/CamelotV2Farm.sol b/contracts/e721-farms/camelotV2/CamelotV2Farm.sol index 94371c09..58834b4d 100644 --- a/contracts/e721-farms/camelotV2/CamelotV2Farm.sol +++ b/contracts/e721-farms/camelotV2/CamelotV2Farm.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/e721-farms/camelotV2/CamelotV2FarmDeployer.sol b/contracts/e721-farms/camelotV2/CamelotV2FarmDeployer.sol index d7ff8ba3..734efe28 100644 --- a/contracts/e721-farms/camelotV2/CamelotV2FarmDeployer.sol +++ b/contracts/e721-farms/camelotV2/CamelotV2FarmDeployer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // @@ -27,10 +27,9 @@ pragma solidity 0.8.16; import {FarmDeployer, IFarmRegistry} from "../../FarmDeployer.sol"; import {CamelotV2Farm, RewardTokenData} from "./CamelotV2Farm.sol"; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; -import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {ICamelotV2Factory} from "./interfaces/ICamelotV2.sol"; -contract CamelotV2FarmDeployer is FarmDeployer, ReentrancyGuard { +contract CamelotV2FarmDeployer is FarmDeployer { // @dev the token Order is not important struct CamelotPoolData { address tokenA; diff --git a/contracts/e721-farms/camelotV2/interfaces/ICamelotV2.sol b/contracts/e721-farms/camelotV2/interfaces/ICamelotV2.sol index 29bccaaa..34a26d70 100644 --- a/contracts/e721-farms/camelotV2/interfaces/ICamelotV2.sol +++ b/contracts/e721-farms/camelotV2/interfaces/ICamelotV2.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT Line -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; diff --git a/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol b/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol index c1fc5dee..ecbfff1f 100644 --- a/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol +++ b/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // @@ -28,9 +28,8 @@ import {FarmDeployer, IFarmRegistry} from "../../FarmDeployer.sol"; import {RewardTokenData, UniswapPoolData} from "./UniV3Farm.sol"; import {UniV3ActiveLiquidityFarm} from "./UniV3ActiveLiquidityFarm.sol"; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; -import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; -contract UniV3ActiveLiquidityDeployer is FarmDeployer, ReentrancyGuard { +contract UniV3ActiveLiquidityDeployer is FarmDeployer { // farmAdmin - Address to which ownership of farm is transferred to post deployment // farmStartTime - Time after which the rewards start accruing for the deposits in the farm. // cooldownPeriod - cooldown period for locked deposits (in days) diff --git a/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityFarm.sol b/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityFarm.sol index 152abbac..0bed5e09 100644 --- a/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityFarm.sol +++ b/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityFarm.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/e721-farms/uniswapV3/UniV3Farm.sol b/contracts/e721-farms/uniswapV3/UniV3Farm.sol index 77788ff1..43bc7535 100644 --- a/contracts/e721-farms/uniswapV3/UniV3Farm.sol +++ b/contracts/e721-farms/uniswapV3/UniV3Farm.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol b/contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol index 9296b18b..74a2f734 100644 --- a/contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol +++ b/contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // @@ -27,9 +27,8 @@ pragma solidity 0.8.16; import {FarmDeployer, IFarmRegistry} from "../../FarmDeployer.sol"; import {UniV3Farm, RewardTokenData, UniswapPoolData} from "./UniV3Farm.sol"; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; -import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; -contract UniV3FarmDeployer is FarmDeployer, ReentrancyGuard { +contract UniV3FarmDeployer is FarmDeployer { // farmAdmin - Address to which ownership of farm is transferred to post deployment // farmStartTime - Time after which the rewards start accruing for the deposits in the farm. // cooldownPeriod - cooldown period for locked deposits (in days) diff --git a/contracts/e721-farms/uniswapV3/interfaces/INonfungiblePositionManagerUtils.sol b/contracts/e721-farms/uniswapV3/interfaces/INonfungiblePositionManagerUtils.sol index e62042a6..64791e36 100644 --- a/contracts/e721-farms/uniswapV3/interfaces/INonfungiblePositionManagerUtils.sol +++ b/contracts/e721-farms/uniswapV3/interfaces/INonfungiblePositionManagerUtils.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; struct Position { uint96 nonce; diff --git a/contracts/e721-farms/uniswapV3/interfaces/IUniswapV3.sol b/contracts/e721-farms/uniswapV3/interfaces/IUniswapV3.sol index e6993f3e..da205b20 100644 --- a/contracts/e721-farms/uniswapV3/interfaces/IUniswapV3.sol +++ b/contracts/e721-farms/uniswapV3/interfaces/IUniswapV3.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; diff --git a/contracts/e721-farms/uniswapV3/interfaces/IUniswapV3Utils.sol b/contracts/e721-farms/uniswapV3/interfaces/IUniswapV3Utils.sol index b379837b..c540b558 100644 --- a/contracts/e721-farms/uniswapV3/interfaces/IUniswapV3Utils.sol +++ b/contracts/e721-farms/uniswapV3/interfaces/IUniswapV3Utils.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; interface IUniswapV3Utils { function fees(address positionManager, uint256 tokenId) external view returns (uint256 amount0, uint256 amount1); diff --git a/contracts/e721-farms/uniswapV3/tests/ISwapRouter.sol b/contracts/e721-farms/uniswapV3/tests/ISwapRouter.sol index d2431872..c28fde08 100644 --- a/contracts/e721-farms/uniswapV3/tests/ISwapRouter.sol +++ b/contracts/e721-farms/uniswapV3/tests/ISwapRouter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {IUniswapV3SwapCallback} from "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol"; diff --git a/contracts/e721-farms/uniswapV3/tests/UniswapV3Test.sol b/contracts/e721-farms/uniswapV3/tests/UniswapV3Test.sol index 4eea0e03..e8525a0d 100644 --- a/contracts/e721-farms/uniswapV3/tests/UniswapV3Test.sol +++ b/contracts/e721-farms/uniswapV3/tests/UniswapV3Test.sol @@ -1,6 +1,6 @@ // This contract is for testing purpose (Arbitrum) // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.16; +pragma solidity 0.8.24; pragma experimental ABIEncoderV2; import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; diff --git a/contracts/features/ExpirableFarm.sol b/contracts/features/ExpirableFarm.sol index a351dc98..2ec6448f 100644 --- a/contracts/features/ExpirableFarm.sol +++ b/contracts/features/ExpirableFarm.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/features/OperableDeposit.sol b/contracts/features/OperableDeposit.sol index ef8388c8..ea182ee3 100644 --- a/contracts/features/OperableDeposit.sol +++ b/contracts/features/OperableDeposit.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/interfaces/DataTypes.sol b/contracts/interfaces/DataTypes.sol index dc68b035..225d8f7b 100644 --- a/contracts/interfaces/DataTypes.sol +++ b/contracts/interfaces/DataTypes.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // Defines the reward data for constructor. // token - Address of the token. diff --git a/contracts/interfaces/IFarm.sol b/contracts/interfaces/IFarm.sol index 8a3abbcf..fc26f6e6 100644 --- a/contracts/interfaces/IFarm.sol +++ b/contracts/interfaces/IFarm.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {RewardData, RewardFund} from "./DataTypes.sol"; diff --git a/contracts/interfaces/IFarmRegistry.sol b/contracts/interfaces/IFarmRegistry.sol index e91d3900..2e1fb215 100644 --- a/contracts/interfaces/IFarmRegistry.sol +++ b/contracts/interfaces/IFarmRegistry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; interface IFarmRegistry { function registerFarm(address farm, address creator) external; diff --git a/contracts/interfaces/IOracle.sol b/contracts/interfaces/IOracle.sol index 585be473..e1f91408 100644 --- a/contracts/interfaces/IOracle.sol +++ b/contracts/interfaces/IOracle.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; interface IOracle { struct PriceData { diff --git a/contracts/interfaces/IRewarderFactory.sol b/contracts/interfaces/IRewarderFactory.sol index f0fe0ebb..d9d8a66b 100644 --- a/contracts/interfaces/IRewarderFactory.sol +++ b/contracts/interfaces/IRewarderFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; interface IRewarderFactory { function oracle() external view returns (address); diff --git a/contracts/rewarder/LegacyFarmRewarder.sol b/contracts/rewarder/LegacyFarmRewarder.sol index 8d2fb189..ea5082d3 100644 --- a/contracts/rewarder/LegacyFarmRewarder.sol +++ b/contracts/rewarder/LegacyFarmRewarder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/rewarder/Rewarder.sol b/contracts/rewarder/Rewarder.sol index dfb87de4..fed149e1 100644 --- a/contracts/rewarder/Rewarder.sol +++ b/contracts/rewarder/Rewarder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // @@ -27,7 +27,7 @@ pragma solidity 0.8.16; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; +import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import {IOracle} from "../interfaces/IOracle.sol"; import {IFarm} from "../interfaces/IFarm.sol"; diff --git a/contracts/rewarder/RewarderFactory.sol b/contracts/rewarder/RewarderFactory.sol index 25b2f269..3b45ef4d 100644 --- a/contracts/rewarder/RewarderFactory.sol +++ b/contracts/rewarder/RewarderFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // @@@@@@@@@@@@@@@@@@***@@@@@@@@@@@@@@@@@@@@@@@@ // diff --git a/contracts/rewarder/interfaces/ILegacyRewarderHelpers.sol b/contracts/rewarder/interfaces/ILegacyRewarderHelpers.sol index 17322ffa..2b7acdb4 100644 --- a/contracts/rewarder/interfaces/ILegacyRewarderHelpers.sol +++ b/contracts/rewarder/interfaces/ILegacyRewarderHelpers.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; interface ICamelotFarm { function nftPool() external view returns (address); diff --git a/contracts/utils/BrownieUtils.sol b/contracts/utils/BrownieUtils.sol index ef4041a5..031b9c20 100644 --- a/contracts/utils/BrownieUtils.sol +++ b/contracts/utils/BrownieUtils.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: UNLICENSED /* solhint-disable */ -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; diff --git a/contracts/utils/TokenUtils.sol b/contracts/utils/TokenUtils.sol index 9f71f090..f1a99bdb 100644 --- a/contracts/utils/TokenUtils.sol +++ b/contracts/utils/TokenUtils.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {INFTPool, IPair} from "../e721-farms/camelotV2/interfaces/ICamelotV2.sol"; import {IUniswapV3PoolState} from "../e721-farms/uniswapV3/interfaces/IUniswapV3.sol"; diff --git a/test/Farm.t.sol b/test/Farm.t.sol index 5270b576..b0508f6e 100644 --- a/test/Farm.t.sol +++ b/test/Farm.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {Farm, RewardTokenData} from "../contracts/Farm.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/test/FarmRegistry.t.sol b/test/FarmRegistry.t.sol index f7384a4a..f123809a 100644 --- a/test/FarmRegistry.t.sol +++ b/test/FarmRegistry.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {Farm, RewardTokenData} from "../contracts/Farm.sol"; import {E20Farm} from "../contracts/e20-farms/E20Farm.sol"; diff --git a/test/e20-farms/E20Farm.t.sol b/test/e20-farms/E20Farm.t.sol index a9a00eb8..b2c86521 100644 --- a/test/e20-farms/E20Farm.t.sol +++ b/test/e20-farms/E20Farm.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {FarmTest} from "../Farm.t.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/test/e20-farms/balancerV2/BalancerV2Farm.t.sol b/test/e20-farms/balancerV2/BalancerV2Farm.t.sol index 23d15355..d4bd7170 100644 --- a/test/e20-farms/balancerV2/BalancerV2Farm.t.sol +++ b/test/e20-farms/balancerV2/BalancerV2Farm.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {IERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/test/e721-farms/E721Farm.t.sol b/test/e721-farms/E721Farm.t.sol index 6981a855..ae3df4d9 100644 --- a/test/e721-farms/E721Farm.t.sol +++ b/test/e721-farms/E721Farm.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {FarmTest, FarmInheritTest} from "../Farm.t.sol"; diff --git a/test/e721-farms/camelotV2/CamelotV2Farm.t.sol b/test/e721-farms/camelotV2/CamelotV2Farm.t.sol index 94357b24..b30c3893 100644 --- a/test/e721-farms/camelotV2/CamelotV2Farm.t.sol +++ b/test/e721-farms/camelotV2/CamelotV2Farm.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/test/e721-farms/uniswapv3/UniV3ActiveLiquidityFarm.t.sol b/test/e721-farms/uniswapv3/UniV3ActiveLiquidityFarm.t.sol index e3ee59ff..b778acd9 100644 --- a/test/e721-farms/uniswapv3/UniV3ActiveLiquidityFarm.t.sol +++ b/test/e721-farms/uniswapv3/UniV3ActiveLiquidityFarm.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // import contracts import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/test/e721-farms/uniswapv3/UniV3Farm.t.sol b/test/e721-farms/uniswapv3/UniV3Farm.t.sol index 7c19f42a..9548ae40 100644 --- a/test/e721-farms/uniswapv3/UniV3Farm.t.sol +++ b/test/e721-farms/uniswapv3/UniV3Farm.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // import contracts import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/test/e721-farms/uniswapv3/sushiswap/SushiswapV3Farm.t.sol b/test/e721-farms/uniswapv3/sushiswap/SushiswapV3Farm.t.sol index b9bde085..9d833dde 100644 --- a/test/e721-farms/uniswapv3/sushiswap/SushiswapV3Farm.t.sol +++ b/test/e721-farms/uniswapv3/sushiswap/SushiswapV3Farm.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // import contracts import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/test/e721-farms/uniswapv3/uniswap/UniswapV3ActiveLiquidityFarm.t.sol b/test/e721-farms/uniswapv3/uniswap/UniswapV3ActiveLiquidityFarm.t.sol index ef4227bc..bb90dc48 100644 --- a/test/e721-farms/uniswapv3/uniswap/UniswapV3ActiveLiquidityFarm.t.sol +++ b/test/e721-farms/uniswapv3/uniswap/UniswapV3ActiveLiquidityFarm.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // import contracts import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/test/e721-farms/uniswapv3/uniswap/UniswapV3Farm.t.sol b/test/e721-farms/uniswapv3/uniswap/UniswapV3Farm.t.sol index 501c64a4..0872e16a 100644 --- a/test/e721-farms/uniswapv3/uniswap/UniswapV3Farm.t.sol +++ b/test/e721-farms/uniswapv3/uniswap/UniswapV3Farm.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; // import contracts import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/test/features/ExpirableFarm.t.sol b/test/features/ExpirableFarm.t.sol index 7f6c5e6b..d731b82b 100644 --- a/test/features/ExpirableFarm.t.sol +++ b/test/features/ExpirableFarm.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {ExpirableFarm} from "../../contracts/features/ExpirableFarm.sol"; import {FarmRegistry} from "../../contracts/FarmRegistry.sol"; diff --git a/test/rewarder/LegacyFarmRewarder.t.sol b/test/rewarder/LegacyFarmRewarder.t.sol index bdfb493b..4eeff3e6 100644 --- a/test/rewarder/LegacyFarmRewarder.t.sol +++ b/test/rewarder/LegacyFarmRewarder.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import "forge-std/console.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/test/rewarder/Rewarder.t.sol b/test/rewarder/Rewarder.t.sol index b2e6ce01..44fd4593 100644 --- a/test/rewarder/Rewarder.t.sol +++ b/test/rewarder/Rewarder.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import "forge-std/console.sol"; import {CamelotV2FarmTest} from "../e721-farms/camelotV2/CamelotV2Farm.t.sol"; diff --git a/test/utils/BaseSetup.t.sol b/test/utils/BaseSetup.t.sol index 5623202e..8bbaa8bf 100644 --- a/test/utils/BaseSetup.t.sol +++ b/test/utils/BaseSetup.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {Test} from "forge-std/Test.sol"; import {Farm} from "../../contracts/Farm.sol"; diff --git a/test/utils/TestNetworkConfig.t.sol b/test/utils/TestNetworkConfig.t.sol index 8a415fd5..d20c2439 100644 --- a/test/utils/TestNetworkConfig.t.sol +++ b/test/utils/TestNetworkConfig.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {Arbitrum} from "./networkConfig/Arbitrum.t.sol"; import {UpgradeUtil} from "./UpgradeUtil.t.sol"; diff --git a/test/utils/UpgradeUtil.t.sol b/test/utils/UpgradeUtil.t.sol index 17bb110b..89d8c6c7 100644 --- a/test/utils/UpgradeUtil.t.sol +++ b/test/utils/UpgradeUtil.t.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: Unlicensed -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; diff --git a/test/utils/networkConfig/Arbitrum.t.sol b/test/utils/networkConfig/Arbitrum.t.sol index eeff87b4..de37ead4 100644 --- a/test/utils/networkConfig/Arbitrum.t.sol +++ b/test/utils/networkConfig/Arbitrum.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; import {BaseSetup} from "../BaseSetup.t.sol"; import {INetworkConfig} from "./INetworkConfig.sol"; diff --git a/test/utils/networkConfig/INetworkConfig.sol b/test/utils/networkConfig/INetworkConfig.sol index 3cf57670..8cd98f5a 100644 --- a/test/utils/networkConfig/INetworkConfig.sol +++ b/test/utils/networkConfig/INetworkConfig.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.24; interface INetworkConfig { function setForkNetwork() external; From e369aad2016e00d4ba83fde26e19d1f0d4f6d91f Mon Sep 17 00:00:00 2001 From: arcantheon Date: Tue, 19 Mar 2024 16:35:43 +0530 Subject: [PATCH 3/9] Ownable constructor param added --- contracts/Farm.sol | 3 +-- contracts/FarmDeployer.sol | 2 +- contracts/FarmRegistry.sol | 2 +- contracts/rewarder/Rewarder.sol | 2 ++ contracts/rewarder/RewarderFactory.sol | 2 +- contracts/utils/BrownieUtils.sol | 17 ----------------- test/utils/UpgradeUtil.t.sol | 2 +- 7 files changed, 7 insertions(+), 23 deletions(-) delete mode 100644 contracts/utils/BrownieUtils.sol diff --git a/contracts/Farm.sol b/contracts/Farm.sol index 0387ed42..c985869c 100644 --- a/contracts/Farm.sol +++ b/contracts/Farm.sol @@ -81,7 +81,7 @@ abstract contract Farm is FarmStorage, Ownable, ReentrancyGuard, Initializable, error InvalidCooldownPeriod(); // Disallow initialization of a implementation contract. - constructor() { + constructor() Ownable(msg.sender) { _disableInitializers(); } @@ -656,7 +656,6 @@ abstract contract Farm is FarmStorage, Ownable, ReentrancyGuard, Initializable, revert InvalidFarmStartTime(); } farmId = _farmId; - _transferOwnership(msg.sender); // Initialize farm global params. lastFundUpdateTime = _farmStartTime; diff --git a/contracts/FarmDeployer.sol b/contracts/FarmDeployer.sol index 156b6f42..79dea43a 100644 --- a/contracts/FarmDeployer.sol +++ b/contracts/FarmDeployer.sol @@ -52,7 +52,7 @@ abstract contract FarmDeployer is Ownable, ReentrancyGuard { /// @notice Constructor. /// @param _farmRegistry Address of the Demeter Farm Registry. /// @param _farmId Id of the farm. - constructor(address _farmRegistry, string memory _farmId) { + constructor(address _farmRegistry, string memory _farmId) Ownable(msg.sender) { _validateNonZeroAddr(_farmRegistry); FARM_REGISTRY = _farmRegistry; farmId = _farmId; diff --git a/contracts/FarmRegistry.sol b/contracts/FarmRegistry.sol index 5cfeab59..298abcb1 100644 --- a/contracts/FarmRegistry.sol +++ b/contracts/FarmRegistry.sol @@ -67,7 +67,7 @@ contract FarmRegistry is OwnableUpgradeable { external initializer { - OwnableUpgradeable.__Ownable_init(); + OwnableUpgradeable.__Ownable_init(msg.sender); updateFeeParams(_feeReceiver, _feeToken, _feeAmount, _extensionFeePerDay); } diff --git a/contracts/rewarder/Rewarder.sol b/contracts/rewarder/Rewarder.sol index fed149e1..e01a0f8d 100644 --- a/contracts/rewarder/Rewarder.sol +++ b/contracts/rewarder/Rewarder.sol @@ -93,6 +93,8 @@ contract Rewarder is Ownable, Initializable, ReentrancyGuard { error InvalidRewardPercentage(uint256 percentage); error CalibrationRestricted(address farm); + constructor() Ownable(msg.sender) {} + /// @notice Initializer function of this contract. /// @param _rwdToken Address of the reward token. /// @param _oracle Address of the USDs Master Price Oracle. diff --git a/contracts/rewarder/RewarderFactory.sol b/contracts/rewarder/RewarderFactory.sol index 3b45ef4d..953942db 100644 --- a/contracts/rewarder/RewarderFactory.sol +++ b/contracts/rewarder/RewarderFactory.sol @@ -42,7 +42,7 @@ contract RewarderFactory is Ownable { /// @notice Constructor of this contract. /// @param _oracle Address of the master price oracle of USDs. - constructor(address _oracle) Ownable() { + constructor(address _oracle) Ownable(msg.sender) { updateOracle(_oracle); rewarderImplementation = address(new Rewarder()); } diff --git a/contracts/utils/BrownieUtils.sol b/contracts/utils/BrownieUtils.sol deleted file mode 100644 index 031b9c20..00000000 --- a/contracts/utils/BrownieUtils.sol +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -/* solhint-disable */ -pragma solidity 0.8.24; - -import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; - -// @note This file is only for facilitating contract imports for brownie script - -contract PA is ProxyAdmin {} - -contract TUP is TransparentUpgradeableProxy { - constructor(address _logic, address admin_, bytes memory _data) - payable - TransparentUpgradeableProxy(_logic, admin_, _data) - {} -} diff --git a/test/utils/UpgradeUtil.t.sol b/test/utils/UpgradeUtil.t.sol index 89d8c6c7..7385ff4c 100644 --- a/test/utils/UpgradeUtil.t.sol +++ b/test/utils/UpgradeUtil.t.sol @@ -8,7 +8,7 @@ contract UpgradeUtil { ProxyAdmin public proxyAdmin; constructor() { - proxyAdmin = new ProxyAdmin(); + proxyAdmin = new ProxyAdmin(msg.sender); } function deployErc1967Proxy(address impl) public returns (address) { From a8cfd61c98a9ebce56907a86f74913d0e623320f Mon Sep 17 00:00:00 2001 From: arcantheon Date: Wed, 20 Mar 2024 14:38:43 +0530 Subject: [PATCH 4/9] Updated UniV3 initialize params --- contracts/Farm.sol | 1 + .../UniV3ActiveLiquidityDeployer.sol | 28 +- contracts/e721-farms/uniswapV3/UniV3Farm.sol | 84 +++--- .../uniswapV3/UniV3FarmDeployer.sol | 25 +- test/e721-farms/uniswapv3/UniV3Farm.t.sol | 260 +++++------------- 5 files changed, 141 insertions(+), 257 deletions(-) diff --git a/contracts/Farm.sol b/contracts/Farm.sol index c985869c..7bd98b7f 100644 --- a/contracts/Farm.sol +++ b/contracts/Farm.sol @@ -656,6 +656,7 @@ abstract contract Farm is FarmStorage, Ownable, ReentrancyGuard, Initializable, revert InvalidFarmStartTime(); } farmId = _farmId; + _transferOwnership(msg.sender); // Initialize farm global params. lastFundUpdateTime = _farmStartTime; diff --git a/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol b/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol index ecbfff1f..bcafb600 100644 --- a/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol +++ b/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol @@ -25,7 +25,7 @@ pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // import {FarmDeployer, IFarmRegistry} from "../../FarmDeployer.sol"; -import {RewardTokenData, UniswapPoolData} from "./UniV3Farm.sol"; +import {RewardTokenData, UniswapPoolData, InitializeInput} from "./UniV3Farm.sol"; import {UniV3ActiveLiquidityFarm} from "./UniV3ActiveLiquidityFarm.sol"; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; @@ -81,20 +81,20 @@ contract UniV3ActiveLiquidityDeployer is FarmDeployer { /// @param _data data for deployment. function createFarm(FarmData memory _data) external nonReentrant returns (address) { _validateNonZeroAddr(_data.farmAdmin); - - UniV3ActiveLiquidityFarm farmInstance = UniV3ActiveLiquidityFarm(Clones.clone(farmImplementation)); - farmInstance.initialize({ - _farmId: farmId, - _farmStartTime: _data.farmStartTime, - _cooldownPeriod: _data.cooldownPeriod, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: _data.uniswapPoolData, - _rwdTokenData: _data.rewardData, - _uniV3Factory: UNI_V3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NFPM_UTILS + InitializeInput memory input = InitializeInput({ + farmId: farmId, + farmStartTime: _data.farmStartTime, + cooldownPeriod: _data.cooldownPeriod, + farmRegistry: FARM_REGISTRY, + uniswapPoolData: _data.uniswapPoolData, + rwdTokenData: _data.rewardData, + uniV3Factory: UNI_V3_FACTORY, + nftContract: NFPM, + uniswapUtils: UNISWAP_UTILS, + nfpmUtils: NFPM_UTILS }); + UniV3ActiveLiquidityFarm farmInstance = UniV3ActiveLiquidityFarm(Clones.clone(farmImplementation)); + farmInstance.initialize({_input: input}); farmInstance.transferOwnership(_data.farmAdmin); address farm = address(farmInstance); // Calculate and collect fee if required diff --git a/contracts/e721-farms/uniswapV3/UniV3Farm.sol b/contracts/e721-farms/uniswapV3/UniV3Farm.sol index 43bc7535..8568c730 100644 --- a/contracts/e721-farms/uniswapV3/UniV3Farm.sol +++ b/contracts/e721-farms/uniswapV3/UniV3Farm.sol @@ -50,6 +50,31 @@ struct UniswapPoolData { int24 tickUpperAllowed; } +// Defines a struct for inputs used for initializing this farm. +// _farmId - String ID of the farm. +// _farmStartTime - time of farm start. +// _cooldownPeriod - cooldown period for locked deposits in days. +// _cooldownPeriod = 0 Disables lockup functionality for the farm. +// _farmRegistry - Address of the Demeter Farm Registry. +// _uniswapPoolData - init data for UniswapV3 pool. +// _rwdTokenData - init data for reward tokens. +// _uniV3Factory - Factory contract of Uniswap V3. +// _nftContract - NFT contract's address (NFPM). +// _uniswapUtils - address of our custom uniswap utils contract. +// _nfpmUtils - address of our custom uniswap nonfungible position manager utils contract +struct InitializeInput { + string farmId; + uint256 farmStartTime; + uint256 cooldownPeriod; + address farmRegistry; + UniswapPoolData uniswapPoolData; + RewardTokenData[] rwdTokenData; + address uniV3Factory; + address nftContract; + address uniswapUtils; + address nfpmUtils; +} + contract UniV3Farm is E721Farm, ExpirableFarm, OperableDeposit { using SafeERC20 for IERC20; @@ -71,52 +96,31 @@ contract UniV3Farm is E721Farm, ExpirableFarm, OperableDeposit { error InvalidTickRange(); error InvalidAmount(); - /// @notice constructor - /// @param _farmId - String ID of the farm. - /// @param _farmStartTime - time of farm start. - /// @param _cooldownPeriod - cooldown period for locked deposits in days. - /// @dev _cooldownPeriod = 0 Disables lockup functionality for the farm. - /// @param _farmRegistry - Address of the Demeter Farm Registry. - /// @param _uniswapPoolData - init data for UniswapV3 pool. - /// @param _rwdTokenData - init data for reward tokens. - /// @param _uniV3Factory - Factory contract of Uniswap V3. - /// @param _nftContract - NFT contract's address (NFPM). - /// @param _uniswapUtils - address of our custom uniswap utils contract. - /// @param _nfpmUtils - address of our custom uniswap nonfungible position manager utils contract. - function initialize( - string calldata _farmId, - uint256 _farmStartTime, - uint256 _cooldownPeriod, - address _farmRegistry, - UniswapPoolData memory _uniswapPoolData, - RewardTokenData[] memory _rwdTokenData, - address _uniV3Factory, - address _nftContract, - address _uniswapUtils, - address _nfpmUtils - ) external initializer { - _validateNonZeroAddr(_uniV3Factory); - _validateNonZeroAddr(_nftContract); - _validateNonZeroAddr(_uniswapUtils); - _validateNonZeroAddr(_nfpmUtils); + /// @notice Initializer function of this farm + /// @param _input A struct having all the input params. + function initialize(InitializeInput calldata _input) external initializer { + _validateNonZeroAddr(_input.uniV3Factory); + _validateNonZeroAddr(_input.nftContract); + _validateNonZeroAddr(_input.uniswapUtils); + _validateNonZeroAddr(_input.nfpmUtils); // initialize uniswap related data - uniswapPool = IUniswapV3Factory(_uniV3Factory).getPool( - _uniswapPoolData.tokenA, _uniswapPoolData.tokenB, _uniswapPoolData.feeTier + uniswapPool = IUniswapV3Factory(_input.uniV3Factory).getPool( + _input.uniswapPoolData.tokenA, _input.uniswapPoolData.tokenB, _input.uniswapPoolData.feeTier ); if (uniswapPool == address(0)) { revert InvalidUniswapPoolConfig(); } - _validateTickRange(_uniswapPoolData.tickLowerAllowed, _uniswapPoolData.tickUpperAllowed); - - tickLowerAllowed = _uniswapPoolData.tickLowerAllowed; - tickUpperAllowed = _uniswapPoolData.tickUpperAllowed; - uniV3Factory = _uniV3Factory; - nftContract = _nftContract; - uniswapUtils = _uniswapUtils; - nfpmUtils = _nfpmUtils; - _setupFarm(_farmId, _farmStartTime, _cooldownPeriod, _rwdTokenData); - _setupFarmExpiry(_farmStartTime, _farmRegistry); + _validateTickRange(_input.uniswapPoolData.tickLowerAllowed, _input.uniswapPoolData.tickUpperAllowed); + + tickLowerAllowed = _input.uniswapPoolData.tickLowerAllowed; + tickUpperAllowed = _input.uniswapPoolData.tickUpperAllowed; + uniV3Factory = _input.uniV3Factory; + nftContract = _input.nftContract; + uniswapUtils = _input.uniswapUtils; + nfpmUtils = _input.nfpmUtils; + _setupFarm(_input.farmId, _input.farmStartTime, _input.cooldownPeriod, _input.rwdTokenData); + _setupFarmExpiry(_input.farmStartTime, _input.farmRegistry); } /// @notice Allow user to increase liquidity for a deposit. diff --git a/contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol b/contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol index 74a2f734..a8ac150b 100644 --- a/contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol +++ b/contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol @@ -25,7 +25,7 @@ pragma solidity 0.8.24; // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // import {FarmDeployer, IFarmRegistry} from "../../FarmDeployer.sol"; -import {UniV3Farm, RewardTokenData, UniswapPoolData} from "./UniV3Farm.sol"; +import {UniV3Farm, RewardTokenData, UniswapPoolData, InitializeInput} from "./UniV3Farm.sol"; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; contract UniV3FarmDeployer is FarmDeployer { @@ -82,18 +82,19 @@ contract UniV3FarmDeployer is FarmDeployer { _validateNonZeroAddr(_data.farmAdmin); UniV3Farm farmInstance = UniV3Farm(Clones.clone(farmImplementation)); - farmInstance.initialize({ - _farmId: farmId, - _farmStartTime: _data.farmStartTime, - _cooldownPeriod: _data.cooldownPeriod, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: _data.uniswapPoolData, - _rwdTokenData: _data.rewardData, - _uniV3Factory: UNI_V3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NFPM_UTILS + InitializeInput memory input = InitializeInput({ + farmId: farmId, + farmStartTime: _data.farmStartTime, + cooldownPeriod: _data.cooldownPeriod, + farmRegistry: FARM_REGISTRY, + uniswapPoolData: _data.uniswapPoolData, + rwdTokenData: _data.rewardData, + uniV3Factory: UNI_V3_FACTORY, + nftContract: NFPM, + uniswapUtils: UNISWAP_UTILS, + nfpmUtils: NFPM_UTILS }); + farmInstance.initialize({_input: input}); farmInstance.transferOwnership(_data.farmAdmin); address farm = address(farmInstance); // Calculate and collect fee if required diff --git a/test/e721-farms/uniswapv3/UniV3Farm.t.sol b/test/e721-farms/uniswapv3/UniV3Farm.t.sol index 9548ae40..ae0cd055 100644 --- a/test/e721-farms/uniswapv3/UniV3Farm.t.sol +++ b/test/e721-farms/uniswapv3/UniV3Farm.t.sol @@ -11,7 +11,8 @@ import { IUniswapV3Factory, IUniswapV3TickSpacing, INFPM, - OperableDeposit + OperableDeposit, + InitializeInput } from "../../../contracts/e721-farms/uniswapV3/UniV3Farm.sol"; import { INFPMUtils, @@ -251,239 +252,116 @@ abstract contract UniV3FarmTest is E721FarmTest { abstract contract InitializeTest is UniV3FarmTest { function test_Initialize_RevertWhen_InvalidTickRange() public { - address uniswapPool = IUniswapV3Factory(UNIV3_FACTORY).getPool(DAI, USDCe, FEE_TIER); - int24 spacing = IUniswapV3TickSpacing(uniswapPool).tickSpacing(); - - // Fails for _tickLower >= _tickUpper - vm.expectRevert(abi.encodeWithSelector(UniV3Farm.InvalidTickRange.selector)); - UniV3Farm(farmProxy).initialize({ - _farmId: FARM_ID, - _farmStartTime: block.timestamp, - _cooldownPeriod: 0, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: UniswapPoolData({ + InitializeInput memory input = InitializeInput({ + farmId: FARM_ID, + farmStartTime: block.timestamp, + cooldownPeriod: COOLDOWN_PERIOD_DAYS, + farmRegistry: FARM_REGISTRY, + uniswapPoolData: UniswapPoolData({ tokenA: DAI, tokenB: USDCe, feeTier: FEE_TIER, tickLowerAllowed: TICK_LOWER, - tickUpperAllowed: TICK_LOWER + tickUpperAllowed: TICK_UPPER }), - _rwdTokenData: generateRewardTokenData(), - _uniV3Factory: UNIV3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS + rwdTokenData: generateRewardTokenData(), + uniV3Factory: UNIV3_FACTORY, + nftContract: NFPM, + uniswapUtils: UNISWAP_UTILS, + nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS }); + address uniswapPool = IUniswapV3Factory(UNIV3_FACTORY).getPool(DAI, USDCe, FEE_TIER); + int24 spacing = IUniswapV3TickSpacing(uniswapPool).tickSpacing(); + + // Fails for _tickLower >= _tickUpper + input.uniswapPoolData.tickUpperAllowed = TICK_LOWER; + vm.expectRevert(abi.encodeWithSelector(UniV3Farm.InvalidTickRange.selector)); + UniV3Farm(farmProxy).initialize({_input: input}); + input.uniswapPoolData.tickUpperAllowed = TICK_UPPER; // Fails for _tickLower < -887272 + input.uniswapPoolData.tickLowerAllowed = -887273; vm.expectRevert(abi.encodeWithSelector(UniV3Farm.InvalidTickRange.selector)); - UniV3Farm(farmProxy).initialize({ - _farmId: FARM_ID, - _farmStartTime: block.timestamp, - _cooldownPeriod: 0, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: UniswapPoolData({ - tokenA: DAI, - tokenB: USDCe, - feeTier: FEE_TIER, - tickLowerAllowed: -887273, - tickUpperAllowed: TICK_UPPER - }), - _rwdTokenData: generateRewardTokenData(), - _uniV3Factory: UNIV3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS - }); + UniV3Farm(farmProxy).initialize({_input: input}); + input.uniswapPoolData.tickLowerAllowed = TICK_LOWER; if (spacing > 1) { // Fails for _tickLower % spacing != 0 + input.uniswapPoolData.tickLowerAllowed = -887271; vm.expectRevert(abi.encodeWithSelector(UniV3Farm.InvalidTickRange.selector)); - UniV3Farm(farmProxy).initialize({ - _farmId: FARM_ID, - _farmStartTime: block.timestamp, - _cooldownPeriod: 0, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: UniswapPoolData({ - tokenA: USDCe, - tokenB: USDT, - feeTier: FEE_TIER, - tickLowerAllowed: -887271, - tickUpperAllowed: TICK_UPPER - }), - _rwdTokenData: generateRewardTokenData(), - _uniV3Factory: UNIV3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS - }); + UniV3Farm(farmProxy).initialize({_input: input}); + input.uniswapPoolData.tickLowerAllowed = TICK_LOWER; // Fails for _tickUpper % spacing != 0 + input.uniswapPoolData.tickUpperAllowed = 887271; vm.expectRevert(abi.encodeWithSelector(UniV3Farm.InvalidTickRange.selector)); - UniV3Farm(farmProxy).initialize({ - _farmId: FARM_ID, - _farmStartTime: block.timestamp, - _cooldownPeriod: 0, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: UniswapPoolData({ - tokenA: DAI, - tokenB: USDCe, - feeTier: FEE_TIER, - tickLowerAllowed: TICK_LOWER, - tickUpperAllowed: 887271 - }), - _rwdTokenData: generateRewardTokenData(), - _uniV3Factory: UNIV3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS - }); + UniV3Farm(farmProxy).initialize({_input: input}); + input.uniswapPoolData.tickUpperAllowed = TICK_UPPER; } // Fails for _tickUpper > 887272 + input.uniswapPoolData.tickUpperAllowed = 887273; vm.expectRevert(abi.encodeWithSelector(UniV3Farm.InvalidTickRange.selector)); - UniV3Farm(farmProxy).initialize({ - _farmId: FARM_ID, - _farmStartTime: block.timestamp, - _cooldownPeriod: 0, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: UniswapPoolData({ - tokenA: DAI, - tokenB: USDCe, - feeTier: FEE_TIER, - tickLowerAllowed: TICK_LOWER, - tickUpperAllowed: 887272 + 1 - }), - _rwdTokenData: generateRewardTokenData(), - _uniV3Factory: UNIV3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS - }); + UniV3Farm(farmProxy).initialize({_input: input}); + input.uniswapPoolData.tickUpperAllowed = TICK_UPPER; } function test_Initialize_RevertWhen_InvalidUniswapPoolConfig() public { - vm.expectRevert(abi.encodeWithSelector(UniV3Farm.InvalidUniswapPoolConfig.selector)); - UniV3Farm(farmProxy).initialize({ - _farmId: FARM_ID, - _farmStartTime: block.timestamp, - _cooldownPeriod: 0, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: UniswapPoolData({ - tokenA: USDCe, // this leads to invalid pool + InitializeInput memory input = InitializeInput({ + farmId: FARM_ID, + farmStartTime: block.timestamp, + cooldownPeriod: COOLDOWN_PERIOD_DAYS, + farmRegistry: FARM_REGISTRY, + uniswapPoolData: UniswapPoolData({ + tokenA: DAI, tokenB: USDCe, feeTier: FEE_TIER, tickLowerAllowed: TICK_LOWER, tickUpperAllowed: TICK_UPPER }), - _rwdTokenData: generateRewardTokenData(), - _uniV3Factory: UNIV3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS + rwdTokenData: generateRewardTokenData(), + uniV3Factory: UNIV3_FACTORY, + nftContract: NFPM, + uniswapUtils: UNISWAP_UTILS, + nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS }); - + input.uniswapPoolData.tokenA = USDCe; vm.expectRevert(abi.encodeWithSelector(UniV3Farm.InvalidUniswapPoolConfig.selector)); - UniV3Farm(farmProxy).initialize({ - _farmId: FARM_ID, - _farmStartTime: block.timestamp, - _cooldownPeriod: 0, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: UniswapPoolData({ - tokenA: USDCe, // this leads to invalid pool - tokenB: USDCe, - feeTier: FEE_TIER, - tickLowerAllowed: -887273, - tickUpperAllowed: TICK_UPPER - }), - _rwdTokenData: generateRewardTokenData(), - _uniV3Factory: UNIV3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS - }); + UniV3Farm(farmProxy).initialize({_input: input}); + input.uniswapPoolData.tokenA = DAI; + input.uniswapPoolData.tokenB = DAI; vm.expectRevert(abi.encodeWithSelector(UniV3Farm.InvalidUniswapPoolConfig.selector)); - UniV3Farm(farmProxy).initialize({ - _farmId: FARM_ID, - _farmStartTime: block.timestamp, - _cooldownPeriod: 0, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: UniswapPoolData({ - tokenA: USDCe, // this leads to invalid pool - tokenB: USDCe, - feeTier: FEE_TIER, - tickLowerAllowed: -887271, - tickUpperAllowed: TICK_UPPER - }), - _rwdTokenData: generateRewardTokenData(), - _uniV3Factory: UNIV3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS - }); + UniV3Farm(farmProxy).initialize({_input: input}); + input.uniswapPoolData.tokenB = USDCe; + input.uniswapPoolData.feeTier = FEE_TIER + 1; vm.expectRevert(abi.encodeWithSelector(UniV3Farm.InvalidUniswapPoolConfig.selector)); - UniV3Farm(farmProxy).initialize({ - _farmId: FARM_ID, - _farmStartTime: block.timestamp, - _cooldownPeriod: 0, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: UniswapPoolData({ - tokenA: USDCe, // this leads to invalid pool - tokenB: USDCe, - feeTier: FEE_TIER, - tickLowerAllowed: TICK_LOWER, - tickUpperAllowed: 887272 + 1 - }), - _rwdTokenData: generateRewardTokenData(), - _uniV3Factory: UNIV3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS - }); - - vm.expectRevert(abi.encodeWithSelector(UniV3Farm.InvalidUniswapPoolConfig.selector)); - UniV3Farm(farmProxy).initialize({ - _farmId: FARM_ID, - _farmStartTime: block.timestamp, - _cooldownPeriod: 0, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: UniswapPoolData({ - tokenA: USDCe, // this leads to invalid pool - tokenB: USDCe, - feeTier: FEE_TIER, - tickLowerAllowed: TICK_LOWER, - tickUpperAllowed: 887271 - }), - _rwdTokenData: generateRewardTokenData(), - _uniV3Factory: UNIV3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS - }); + UniV3Farm(farmProxy).initialize({_input: input}); + input.uniswapPoolData.feeTier = FEE_TIER; } - function test_initialize() public { - address uniswapPool = IUniswapV3Factory(UNIV3_FACTORY).getPool(DAI, USDCe, FEE_TIER); - UniV3Farm(farmProxy).initialize({ - _farmId: FARM_ID, - _farmStartTime: block.timestamp, - _cooldownPeriod: COOLDOWN_PERIOD_DAYS, - _farmRegistry: FARM_REGISTRY, - _uniswapPoolData: UniswapPoolData({ + function test_Initialize() public { + InitializeInput memory input = InitializeInput({ + farmId: FARM_ID, + farmStartTime: block.timestamp, + cooldownPeriod: COOLDOWN_PERIOD_DAYS, + farmRegistry: FARM_REGISTRY, + uniswapPoolData: UniswapPoolData({ tokenA: DAI, tokenB: USDCe, feeTier: FEE_TIER, tickLowerAllowed: TICK_LOWER, tickUpperAllowed: TICK_UPPER }), - _rwdTokenData: generateRewardTokenData(), - _uniV3Factory: UNIV3_FACTORY, - _nftContract: NFPM, - _uniswapUtils: UNISWAP_UTILS, - _nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS + rwdTokenData: generateRewardTokenData(), + uniV3Factory: UNIV3_FACTORY, + nftContract: NFPM, + uniswapUtils: UNISWAP_UTILS, + nfpmUtils: NONFUNGIBLE_POSITION_MANAGER_UTILS }); + address uniswapPool = IUniswapV3Factory(UNIV3_FACTORY).getPool(DAI, USDCe, FEE_TIER); + UniV3Farm(farmProxy).initialize({_input: input}); assertEq(UniV3Farm(farmProxy).farmId(), FARM_ID); assertEq(UniV3Farm(farmProxy).tickLowerAllowed(), TICK_LOWER); From e124db1a14419b29ca94cb161238e11f24a81406 Mon Sep 17 00:00:00 2001 From: arcantheon Date: Wed, 20 Mar 2024 16:13:30 +0530 Subject: [PATCH 5/9] Updated solhint compiler version --- .solhint.json | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.solhint.json b/.solhint.json index 51ca99dc..3b6d39a7 100644 --- a/.solhint.json +++ b/.solhint.json @@ -1,17 +1,27 @@ { "extends": "solhint:recommended", - "rules": { - "compiler-version": ["error", "0.8.16"], + "compiler-version": [ + "error", + "0.8.24" + ], "ordering": "error", "avoid-throw": "off", "avoid-suicide": "error", "avoid-sha3": "warn", "not-rely-on-time": "off", "no-console": "error", - "func-named-parameters": ["warn", 4], - "func-visibility": ["error", { "ignoreConstructors": true }], + "func-named-parameters": [ + "warn", + 4 + ], + "func-visibility": [ + "error", + { + "ignoreConstructors": true + } + ], "one-contract-per-file": "off", "contract-name-camelcase": "off" } -} +} \ No newline at end of file From 21c832a55efc47896fd6c65562a9dc41a51ce035 Mon Sep 17 00:00:00 2001 From: arcantheon Date: Wed, 20 Mar 2024 16:14:01 +0530 Subject: [PATCH 6/9] Fixed breaking changes and solhint warnings --- contracts/e20-farms/E20Farm.sol | 1 - contracts/e721-farms/camelotV2/CamelotV2Farm.sol | 1 - contracts/e721-farms/uniswapV3/UniV3Farm.sol | 11 +++++++---- contracts/rewarder/LegacyFarmRewarder.sol | 14 +++++++------- contracts/rewarder/Rewarder.sol | 2 +- .../rewarder/interfaces/ILegacyRewarderHelpers.sol | 2 +- test/Farm.t.sol | 6 ++++-- test/FarmRegistry.t.sol | 5 +++-- test/rewarder/Rewarder.t.sol | 9 +++++---- 9 files changed, 28 insertions(+), 23 deletions(-) diff --git a/contracts/e20-farms/E20Farm.sol b/contracts/e20-farms/E20Farm.sol index 8efe1449..2337dc7f 100644 --- a/contracts/e20-farms/E20Farm.sol +++ b/contracts/e20-farms/E20Farm.sol @@ -27,7 +27,6 @@ pragma solidity 0.8.24; import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {RewardTokenData} from "../Farm.sol"; import {ExpirableFarm} from "../features/ExpirableFarm.sol"; -import {Deposit} from "../interfaces/DataTypes.sol"; import {OperableDeposit} from "../features/OperableDeposit.sol"; abstract contract E20Farm is ExpirableFarm, OperableDeposit { diff --git a/contracts/e721-farms/camelotV2/CamelotV2Farm.sol b/contracts/e721-farms/camelotV2/CamelotV2Farm.sol index 58834b4d..26c74daf 100644 --- a/contracts/e721-farms/camelotV2/CamelotV2Farm.sol +++ b/contracts/e721-farms/camelotV2/CamelotV2Farm.sol @@ -29,7 +29,6 @@ import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol import {INFTPoolFactory, INFTPool, INFTHandler, IPair, IRouter} from "./interfaces/ICamelotV2.sol"; import {RewardTokenData} from "../../Farm.sol"; import {Farm, E721Farm} from "../E721Farm.sol"; -import {Deposit} from "../../interfaces/DataTypes.sol"; import {OperableDeposit} from "../../features/OperableDeposit.sol"; import {ExpirableFarm} from "../../features/ExpirableFarm.sol"; import {TokenUtils} from "../../utils/TokenUtils.sol"; diff --git a/contracts/e721-farms/uniswapV3/UniV3Farm.sol b/contracts/e721-farms/uniswapV3/UniV3Farm.sol index 8568c730..393baec1 100644 --- a/contracts/e721-farms/uniswapV3/UniV3Farm.sol +++ b/contracts/e721-farms/uniswapV3/UniV3Farm.sol @@ -32,7 +32,6 @@ import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol import {INFPM, IUniswapV3Factory, IUniswapV3TickSpacing} from "./interfaces/IUniswapV3.sol"; import {IUniswapV3Utils} from "./interfaces/IUniswapV3Utils.sol"; import {INFPMUtils, Position} from "./interfaces/INonfungiblePositionManagerUtils.sol"; -import {Deposit} from "../../interfaces/DataTypes.sol"; import {OperableDeposit} from "../../features/OperableDeposit.sol"; import {TokenUtils} from "../../utils/TokenUtils.sol"; @@ -240,9 +239,13 @@ contract UniV3Farm is E721Farm, ExpirableFarm, OperableDeposit { /// @notice A function to be called by Demeter Rewarder to get tokens and amounts associated with the farm's liquidity. function getTokenAmounts() external view override returns (address[] memory, uint256[] memory) { - return TokenUtils.getUniV3TokenAmounts( - uniswapPool, uniswapUtils, tickLowerAllowed, tickUpperAllowed, rewardFunds[COMMON_FUND_ID].totalLiquidity - ); + return TokenUtils.getUniV3TokenAmounts({ + _uniPool: uniswapPool, + _uniUtils: uniswapUtils, + _tickLower: tickLowerAllowed, + _tickUpper: tickUpperAllowed, + _liquidity: rewardFunds[COMMON_FUND_ID].totalLiquidity + }); } // --------------------- Public and overriding Functions --------------------- diff --git a/contracts/rewarder/LegacyFarmRewarder.sol b/contracts/rewarder/LegacyFarmRewarder.sol index ea5082d3..3c0c5ea2 100644 --- a/contracts/rewarder/LegacyFarmRewarder.sol +++ b/contracts/rewarder/LegacyFarmRewarder.sol @@ -73,13 +73,13 @@ contract LegacyFarmRewarder is Rewarder { function _getTokenAmounts(address _farm) internal view override returns (address[] memory, uint256[] memory) { uint256 totalLiquidity = IFarm(_farm).getRewardFundInfo(COMMON_FUND_ID).totalLiquidity; if (isUniV3Farm[_farm]) { - return TokenUtils.getUniV3TokenAmounts( - IUniswapV3Farm(_farm).uniswapPool(), - UNISWAP_UTILS, - IUniswapV3Farm(_farm).tickLowerAllowed(), - IUniswapV3Farm(_farm).tickUpperAllowed(), - totalLiquidity - ); + return TokenUtils.getUniV3TokenAmounts({ + _uniPool: IUniswapV3Farm(_farm).uniswapPool(), + _uniUtils: UNISWAP_UTILS, + _tickLower: IUniswapV3Farm(_farm).tickLowerAllowed(), + _tickUpper: IUniswapV3Farm(_farm).tickUpperAllowed(), + _liquidity: totalLiquidity + }); } else { return TokenUtils.getUniV2TokenAmounts(ICamelotFarm(_farm).nftPool(), totalLiquidity); } diff --git a/contracts/rewarder/Rewarder.sol b/contracts/rewarder/Rewarder.sol index e01a0f8d..ad9d763a 100644 --- a/contracts/rewarder/Rewarder.sol +++ b/contracts/rewarder/Rewarder.sol @@ -72,7 +72,7 @@ contract Rewarder is Ownable, Initializable, ReentrancyGuard { uint256 public constant REWARD_PERIOD = 1 weeks; uint256 public constant DENOMINATOR = 100; uint256 public constant ONE_YEAR = 365 days; - address public REWARD_TOKEN; + address public REWARD_TOKEN; // solhint-disable-line var-name-mixedcase uint256 public totalRewardRate; // Rewards emitted per second for all the farms from this rewarder. address public rewarderFactory; // farm -> FarmRewardConfig diff --git a/contracts/rewarder/interfaces/ILegacyRewarderHelpers.sol b/contracts/rewarder/interfaces/ILegacyRewarderHelpers.sol index 2b7acdb4..ce736397 100644 --- a/contracts/rewarder/interfaces/ILegacyRewarderHelpers.sol +++ b/contracts/rewarder/interfaces/ILegacyRewarderHelpers.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.24; interface ICamelotFarm { function nftPool() external view returns (address); - function FARM_ID() external view returns (string memory); + function FARM_ID() external view returns (string memory); // solhint-disable-line func-name-mixedcase } interface IUniswapV3Farm { diff --git a/test/Farm.t.sol b/test/Farm.t.sol index b0508f6e..b0ac9d65 100644 --- a/test/Farm.t.sol +++ b/test/Farm.t.sol @@ -1,6 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.24; +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {Farm, RewardTokenData} from "../contracts/Farm.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; @@ -1128,7 +1130,7 @@ abstract contract MulticallTest is FarmTest { bytes[] memory data = new bytes[](3); data[0] = abi.encodeWithSelector(Farm.updateCooldownPeriod.selector, cooldownPeriodInDays); - vm.expectRevert("Ownable: caller is not the owner"); + vm.expectRevert(abi.encodeWithSelector(Ownable.OwnableUnauthorizedAccount.selector, user)); Farm(lockupFarm).multicall(data); } } @@ -1137,7 +1139,7 @@ abstract contract MulticallTest is FarmTest { bytes[] memory data = new bytes[](1); data[0] = abi.encodeWithSignature("_updateFarmRewardData()"); - vm.expectRevert("Address: low-level delegate call failed"); + vm.expectRevert(Address.FailedInnerCall.selector); Farm(lockupFarm).multicall(data); } } diff --git a/test/FarmRegistry.t.sol b/test/FarmRegistry.t.sol index f123809a..5a2b8544 100644 --- a/test/FarmRegistry.t.sol +++ b/test/FarmRegistry.t.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.24; +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {Farm, RewardTokenData} from "../contracts/Farm.sol"; import {E20Farm} from "../contracts/e20-farms/E20Farm.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; @@ -198,7 +199,7 @@ contract UpdatePrivilegeTest is FarmRegistryTest { deployerRegistered { vm.startPrank(owner); - vm.expectRevert("Ownable: caller is not the owner"); + vm.expectRevert(abi.encodeWithSelector(Ownable.OwnableUnauthorizedAccount.selector, owner)); FarmRegistry(registry).updatePrivilege(owner, false); } @@ -226,7 +227,7 @@ contract UpdateFeeParamsTest is FarmRegistryTest { deployerRegistered { vm.startPrank(owner); - vm.expectRevert("Ownable: caller is not the owner"); + vm.expectRevert(abi.encodeWithSelector(Ownable.OwnableUnauthorizedAccount.selector, owner)); FarmRegistry(registry).updateFeeParams(owner, USDS, FEE_AMOUNT, EXTENSION_FEE_PER_DAY); } diff --git a/test/rewarder/Rewarder.t.sol b/test/rewarder/Rewarder.t.sol index 44fd4593..e314db33 100644 --- a/test/rewarder/Rewarder.t.sol +++ b/test/rewarder/Rewarder.t.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.24; import "forge-std/console.sol"; +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {CamelotV2FarmTest} from "../e721-farms/camelotV2/CamelotV2Farm.t.sol"; import {CamelotV2Farm} from "../../contracts/e721-farms/camelotV2/CamelotV2Farm.sol"; import {RewarderFactory} from "../../contracts/rewarder/RewarderFactory.sol"; @@ -38,8 +39,8 @@ contract TestInitialization is RewarderTest { } contract TestUpdateTokenManagerOfFarm is RewarderTest { - function test_RevertsWhen_CallerIsNotTheOwner() public { - vm.expectRevert("Ownable: caller is not the owner"); + function test_RevertWhen_CallerIsNotTheOwner() public useKnownActor(actors[5]) { + vm.expectRevert(abi.encodeWithSelector(Ownable.OwnableUnauthorizedAccount.selector, actors[5])); rewarder.updateTokenManagerOfFarm(lockupFarm, actors[1]); } @@ -58,8 +59,8 @@ contract TestUpdateTokenManagerOfFarm is RewarderTest { contract TestUpdateAPR is RewarderTest { uint256 private constant APR = 1e9; - function test_RevertWhen_updateAPR_CallerIsNotTheOwner() public { - vm.expectRevert("Ownable: caller is not the owner"); + function test_RevertWhen_updateAPR_CallerIsNotTheOwner() public useKnownActor(actors[5]) { + vm.expectRevert(abi.encodeWithSelector(Ownable.OwnableUnauthorizedAccount.selector, actors[5])); rewarder.updateAPR(lockupFarm, APR); } From 76e50471a22a8dd133642d334f3a42198fa7bb0c Mon Sep 17 00:00:00 2001 From: arcantheon Date: Wed, 20 Mar 2024 16:39:42 +0530 Subject: [PATCH 7/9] Removed underscores from struct member's definition --- contracts/e721-farms/uniswapV3/UniV3Farm.sol | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/contracts/e721-farms/uniswapV3/UniV3Farm.sol b/contracts/e721-farms/uniswapV3/UniV3Farm.sol index e8c73730..0610971c 100644 --- a/contracts/e721-farms/uniswapV3/UniV3Farm.sol +++ b/contracts/e721-farms/uniswapV3/UniV3Farm.sol @@ -50,17 +50,17 @@ struct UniswapPoolData { } // Defines a struct for inputs used for initializing this farm. -// _farmId - String ID of the farm. -// _farmStartTime - time of farm start. -// _cooldownPeriod - cooldown period for locked deposits in days. -// _cooldownPeriod = 0 Disables lockup functionality for the farm. -// _farmRegistry - Address of the Demeter Farm Registry. -// _uniswapPoolData - init data for UniswapV3 pool. -// _rwdTokenData - init data for reward tokens. -// _uniV3Factory - Factory contract of Uniswap V3. -// _nftContract - NFT contract's address (NFPM). -// _uniswapUtils - address of our custom uniswap utils contract. -// _nfpmUtils - address of our custom uniswap nonfungible position manager utils contract +// farmId - String ID of the farm. +// farmStartTime - time of farm start. +// cooldownPeriod - cooldown period for locked deposits in days. +// cooldownPeriod = 0 Disables lockup functionality for the farm. +// farmRegistry - Address of the Demeter Farm Registry. +// uniswapPoolData - init data for UniswapV3 pool. +// rwdTokenData - init data for reward tokens. +// uniV3Factory - Factory contract of Uniswap V3. +// nftContract - NFT contract's address (NFPM). +// uniswapUtils - address of our custom uniswap utils contract. +// nfpmUtils - address of our custom uniswap nonfungible position manager utils contract struct InitializeInput { string farmId; uint256 farmStartTime; From cff8748b913c227f7ca2dcf5d636b220662e905a Mon Sep 17 00:00:00 2001 From: Parv3213 Date: Wed, 20 Mar 2024 16:49:55 +0530 Subject: [PATCH 8/9] perf: minor changes --- .solhint.json | 19 +- .../e721-farms/camelotV3/CamelotV3Farm.sol | 12 +- .../UniV3ActiveLiquidityDeployer.sol | 27 +- contracts/e721-farms/uniswapV3/UniV3Farm.sol | 1 - .../uniswapV3/UniV3FarmDeployer.sol | 27 +- foundry.toml | 1 + package-lock.json | 897 ++++++++++++++---- test/e721-farms/camelotV3/CamelotV3Farm.t.sol | 2 +- test/e721-farms/uniswapv3/UniV3Farm.t.sol | 2 +- 9 files changed, 742 insertions(+), 246 deletions(-) diff --git a/.solhint.json b/.solhint.json index 3b6d39a7..a3a71dc5 100644 --- a/.solhint.json +++ b/.solhint.json @@ -1,27 +1,16 @@ { "extends": "solhint:recommended", "rules": { - "compiler-version": [ - "error", - "0.8.24" - ], + "compiler-version": ["error", "0.8.24"], "ordering": "error", "avoid-throw": "off", "avoid-suicide": "error", "avoid-sha3": "warn", "not-rely-on-time": "off", "no-console": "error", - "func-named-parameters": [ - "warn", - 4 - ], - "func-visibility": [ - "error", - { - "ignoreConstructors": true - } - ], + "func-named-parameters": ["warn", 4], + "func-visibility": ["error", { "ignoreConstructors": true }], "one-contract-per-file": "off", "contract-name-camelcase": "off" } -} \ No newline at end of file +} diff --git a/contracts/e721-farms/camelotV3/CamelotV3Farm.sol b/contracts/e721-farms/camelotV3/CamelotV3Farm.sol index f947b126..3ea4e6e5 100644 --- a/contracts/e721-farms/camelotV3/CamelotV3Farm.sol +++ b/contracts/e721-farms/camelotV3/CamelotV3Farm.sol @@ -30,9 +30,7 @@ import {ExpirableFarm} from "../../features/ExpirableFarm.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {INFPM, ICamelotV3Factory, ICamelotV3TickSpacing} from "./interfaces/ICamelotV3.sol"; -import {ICamelotV3Utils} from "./interfaces/ICamelotV3Utils.sol"; import {ICamelotV3NFPMUtils, Position} from "./interfaces/ICamelotV3NonfungiblePositionManagerUtils.sol"; -import {Deposit} from "../../interfaces/DataTypes.sol"; import {OperableDeposit} from "../../features/OperableDeposit.sol"; import {TokenUtils} from "../../utils/TokenUtils.sol"; @@ -229,9 +227,13 @@ contract CamelotV3Farm is E721Farm, ExpirableFarm, OperableDeposit { /// @notice A function to be called by Demeter Rewarder to get tokens and amounts associated with the farm's liquidity. function getTokenAmounts() external view override returns (address[] memory, uint256[] memory) { - return TokenUtils.getCamelotV3TokenAmounts( - camelotPool, camelotUtils, tickLowerAllowed, tickUpperAllowed, rewardFunds[COMMON_FUND_ID].totalLiquidity - ); + return TokenUtils.getCamelotV3TokenAmounts({ + _camelotPool: camelotPool, + _camelotUtils: camelotUtils, + _tickLower: tickLowerAllowed, + _tickUpper: tickUpperAllowed, + _liquidity: rewardFunds[COMMON_FUND_ID].totalLiquidity + }); } // --------------------- Public and overriding Functions --------------------- diff --git a/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol b/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol index bcafb600..d0d1248c 100644 --- a/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol +++ b/contracts/e721-farms/uniswapV3/UniV3ActiveLiquidityDeployer.sol @@ -81,20 +81,21 @@ contract UniV3ActiveLiquidityDeployer is FarmDeployer { /// @param _data data for deployment. function createFarm(FarmData memory _data) external nonReentrant returns (address) { _validateNonZeroAddr(_data.farmAdmin); - InitializeInput memory input = InitializeInput({ - farmId: farmId, - farmStartTime: _data.farmStartTime, - cooldownPeriod: _data.cooldownPeriod, - farmRegistry: FARM_REGISTRY, - uniswapPoolData: _data.uniswapPoolData, - rwdTokenData: _data.rewardData, - uniV3Factory: UNI_V3_FACTORY, - nftContract: NFPM, - uniswapUtils: UNISWAP_UTILS, - nfpmUtils: NFPM_UTILS - }); UniV3ActiveLiquidityFarm farmInstance = UniV3ActiveLiquidityFarm(Clones.clone(farmImplementation)); - farmInstance.initialize({_input: input}); + farmInstance.initialize( + InitializeInput({ + farmId: farmId, + farmStartTime: _data.farmStartTime, + cooldownPeriod: _data.cooldownPeriod, + farmRegistry: FARM_REGISTRY, + uniswapPoolData: _data.uniswapPoolData, + rwdTokenData: _data.rewardData, + uniV3Factory: UNI_V3_FACTORY, + nftContract: NFPM, + uniswapUtils: UNISWAP_UTILS, + nfpmUtils: NFPM_UTILS + }) + ); farmInstance.transferOwnership(_data.farmAdmin); address farm = address(farmInstance); // Calculate and collect fee if required diff --git a/contracts/e721-farms/uniswapV3/UniV3Farm.sol b/contracts/e721-farms/uniswapV3/UniV3Farm.sol index 0610971c..7afcbdc4 100644 --- a/contracts/e721-farms/uniswapV3/UniV3Farm.sol +++ b/contracts/e721-farms/uniswapV3/UniV3Farm.sol @@ -30,7 +30,6 @@ import {ExpirableFarm} from "../../features/ExpirableFarm.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {INFPM, IUniswapV3Factory, IUniswapV3TickSpacing} from "./interfaces/IUniswapV3.sol"; -import {IUniswapV3Utils} from "./interfaces/IUniswapV3Utils.sol"; import {INFPMUtils, Position} from "./interfaces/INonfungiblePositionManagerUtils.sol"; import {OperableDeposit} from "../../features/OperableDeposit.sol"; import {TokenUtils} from "../../utils/TokenUtils.sol"; diff --git a/contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol b/contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol index a8ac150b..3ca982cb 100644 --- a/contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol +++ b/contracts/e721-farms/uniswapV3/UniV3FarmDeployer.sol @@ -82,19 +82,20 @@ contract UniV3FarmDeployer is FarmDeployer { _validateNonZeroAddr(_data.farmAdmin); UniV3Farm farmInstance = UniV3Farm(Clones.clone(farmImplementation)); - InitializeInput memory input = InitializeInput({ - farmId: farmId, - farmStartTime: _data.farmStartTime, - cooldownPeriod: _data.cooldownPeriod, - farmRegistry: FARM_REGISTRY, - uniswapPoolData: _data.uniswapPoolData, - rwdTokenData: _data.rewardData, - uniV3Factory: UNI_V3_FACTORY, - nftContract: NFPM, - uniswapUtils: UNISWAP_UTILS, - nfpmUtils: NFPM_UTILS - }); - farmInstance.initialize({_input: input}); + farmInstance.initialize( + InitializeInput({ + farmId: farmId, + farmStartTime: _data.farmStartTime, + cooldownPeriod: _data.cooldownPeriod, + farmRegistry: FARM_REGISTRY, + uniswapPoolData: _data.uniswapPoolData, + rwdTokenData: _data.rewardData, + uniV3Factory: UNI_V3_FACTORY, + nftContract: NFPM, + uniswapUtils: UNISWAP_UTILS, + nfpmUtils: NFPM_UTILS + }) + ); farmInstance.transferOwnership(_data.farmAdmin); address farm = address(farmInstance); // Calculate and collect fee if required diff --git a/foundry.toml b/foundry.toml index 07e9aa45..40e46775 100644 --- a/foundry.toml +++ b/foundry.toml @@ -2,5 +2,6 @@ src = "contracts" out = "out" libs = ["node_modules", "lib"] +solc = "0.8.24" # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/package-lock.json b/package-lock.json index 7942b89f..76bacf1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,13 +22,13 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", + "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" + "@babel/highlight": "^7.24.2", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -44,14 +44,15 @@ } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", + "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -67,9 +68,9 @@ } }, "node_modules/@cryptoalgebra/v1.9-directional-fee-periphery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@cryptoalgebra/v1.9-directional-fee-periphery/-/v1.9-directional-fee-periphery-1.0.1.tgz", - "integrity": "sha512-TsFO3S2mpqrtnoIm2rHUylWfv5mKHh5I6I46GivBLWQzvVjwZesOHdfbuZKpTB6OtCeJC5FlmUSXXA2a0JTQiA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@cryptoalgebra/v1.9-directional-fee-periphery/-/v1.9-directional-fee-periphery-1.0.2.tgz", + "integrity": "sha512-YvYGTiFHwh/BEJz/wKMqVZWsOcaPkBHZosO0Bp52+ua2Hhcr1K67HX9Qa547OiGdjjiSOZYcHQzt+YQQTMLAew==", "dependencies": { "@cryptoalgebra/v1.9-directional-fee-core": "^1.0.0", "@openzeppelin/contracts": "3.4.1-solc-0.7-2", @@ -99,6 +100,15 @@ "@openzeppelin/contracts": "5.0.2" } }, + "node_modules/@solidity-parser/parser": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.2.tgz", + "integrity": "sha512-PI9NfoA3P8XK2VBkK5oIfRgKDsicwDZfkVq9ZTBCQYGOP1N2owgY2dyLGyU5/J/hQs8KRk55kdmvTLjy3Mu3vg==", + "dev": true, + "dependencies": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, "node_modules/@uniswap/lib": { "version": "4.0.1-alpha", "resolved": "https://registry.npmjs.org/@uniswap/lib/-/lib-4.0.1-alpha.tgz", @@ -124,14 +134,14 @@ } }, "node_modules/@uniswap/v3-periphery": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/@uniswap/v3-periphery/-/v3-periphery-1.4.3.tgz", - "integrity": "sha512-80c+wtVzl5JJT8UQskxVYYG3oZb4pkhY0zDe0ab/RX4+8f9+W5d8wI4BT0wLB0wFQTSnbW+QdBSpkHA/vRyGBA==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@uniswap/v3-periphery/-/v3-periphery-1.4.4.tgz", + "integrity": "sha512-S4+m+wh8HbWSO3DKk4LwUCPZJTpCugIsHrWR86m/OrUyvSqGDTXKFfc2sMuGXCZrD1ZqO3rhQsKgdWg3Hbb2Kw==", "dependencies": { "@openzeppelin/contracts": "3.4.2-solc-0.7", "@uniswap/lib": "^4.0.1-alpha", - "@uniswap/v2-core": "1.0.1", - "@uniswap/v3-core": "1.0.0", + "@uniswap/v2-core": "^1.0.1", + "@uniswap/v3-core": "^1.0.0", "base64-sol": "1.0.1" }, "engines": { @@ -143,14 +153,6 @@ "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-3.4.2-solc-0.7.tgz", "integrity": "sha512-W6QmqgkADuFcTLzHL8vVoNBtkwjvQRpYIAom7KiUNoLKghyx3FgH0GBjt8NRvigV1ZmMOBllvE1By1C+bi8WpA==" }, - "node_modules/@uniswap/v3-periphery/node_modules/@uniswap/v3-core": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@uniswap/v3-core/-/v3-core-1.0.0.tgz", - "integrity": "sha512-kSC4djMGKMHj7sLMYVnn61k9nu+lHjMIxgg9CDQT+s2QYLoA56GbSK9Oxr+qJXzzygbkrmuY6cwgP6cW2JXPFA==", - "engines": { - "node": ">=10" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -209,6 +211,44 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/ast-parents": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/ast-parents/-/ast-parents-0.0.1.tgz", @@ -224,6 +264,21 @@ "node": ">=8" } }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -246,13 +301,19 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -380,12 +441,81 @@ "node": ">=4.8" } }, - "node_modules/define-properties": { + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-data-property": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, @@ -396,6 +526,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -406,34 +542,57 @@ } }, "node_modules/es-abstract": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", - "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", + "version": "1.23.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.2.tgz", + "integrity": "sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.1", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.2", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.3", "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", + "object-inspect": "^1.13.1", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "regexp.prototype.flags": "^1.4.3", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", - "unbox-primitive": "^1.0.2" + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.5", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" }, "engines": { "node": ">= 0.4" @@ -442,6 +601,53 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -475,9 +681,9 @@ "dev": true }, "node_modules/fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", "dev": true }, "node_modules/fast-json-stable-stringify": { @@ -486,6 +692,15 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -493,21 +708,24 @@ "dev": true }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" @@ -526,27 +744,33 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" }, "engines": { "node": ">= 0.4" @@ -595,24 +819,39 @@ "node": ">=10" } }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true - }, - "node_modules/has": { + "node_modules/globalthis": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", "dev": true, "dependencies": { - "function-bind": "^1.1.1" + "define-properties": "^1.1.3" }, "engines": { - "node": ">= 0.4.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -632,12 +871,24 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -656,12 +907,12 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -670,6 +921,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -692,9 +955,9 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "engines": { "node": ">= 4" @@ -733,19 +996,35 @@ "dev": true }, "node_modules/internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.0", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "hasown": "^2.0.0", "side-channel": "^1.0.4" }, "engines": { "node": ">= 0.4" } }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -781,9 +1060,9 @@ } }, "node_modules/is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "engines": { "node": ">= 0.4" @@ -793,12 +1072,27 @@ } }, "node_modules/is-core-module": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", - "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", "dev": true, "dependencies": { - "has": "^1.0.3" + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -829,9 +1123,9 @@ } }, "node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, "engines": { "node": ">= 0.4" @@ -872,12 +1166,15 @@ } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -913,6 +1210,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", @@ -925,6 +1237,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1077,9 +1395,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1095,13 +1413,13 @@ } }, "node_modules/object.assign": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.3.tgz", - "integrity": "sha512-ZFJnX3zltyjcYJL0RoCJuzb+11zWGyaDbjgxZbdV7rFEcHQuYxrZqhow67aA7xpes6LhojyFDaBKAFfogQrikA==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, @@ -1173,6 +1491,12 @@ "node": ">=4" } }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, "node_modules/pidtree": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", @@ -1203,6 +1527,15 @@ "node": ">=4" } }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/prettier": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", @@ -1220,9 +1553,9 @@ } }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "engines": { "node": ">=6" @@ -1243,14 +1576,15 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" }, "engines": { "node": ">= 0.4" @@ -1269,12 +1603,12 @@ } }, "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -1294,15 +1628,82 @@ "node": ">=4" } }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -1325,20 +1726,27 @@ } }, "node_modules/shell-quote": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", - "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", - "dev": true + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1425,15 +1833,6 @@ "prettier": "^2.8.3" } }, - "node_modules/solhint/node_modules/@solidity-parser/parser": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.1.tgz", - "integrity": "sha512-PdhRFNhbTtu3x8Axm0uYpqOy/lODYQK+MlYSgqIsq2L8SFYEHJPHNUiOTAJbDGzNjjr1/n9AcIayxafR/fWmYw==", - "dev": true, - "dependencies": { - "antlr4ts": "^0.5.0-alpha.4" - } - }, "node_modules/solhint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -1493,9 +1892,9 @@ } }, "node_modules/solhint/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1520,9 +1919,9 @@ } }, "node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", "dev": true, "dependencies": { "spdx-expression-parse": "^3.0.0", @@ -1530,9 +1929,9 @@ } }, "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", "dev": true }, "node_modules/spdx-expression-parse": { @@ -1546,9 +1945,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", - "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", "dev": true }, "node_modules/string-width": { @@ -1565,21 +1964,33 @@ "node": ">=8" } }, - "node_modules/string-width/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "node_modules/string.prototype.padend": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.3.tgz", - "integrity": "sha512-jNIIeokznm8SD/TZISQsZKYu7RJyheFNt84DUPrh482GC8RVp2MKqm2O5oBRdGxbDQoXrhhWtPIWQOiy20svUg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.5.tgz", + "integrity": "sha512-DOB27b/2UTTD+4myKUFh+/fXWcu/UDyASIXfg+7VzoCNNGOfWvoyU/x5pvVHr++ztyt/oSYI1BcWBBG/hmlNjA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -1589,28 +2000,28 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", - "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", - "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1705,6 +2116,79 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", + "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -1767,6 +2251,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/test/e721-farms/camelotV3/CamelotV3Farm.t.sol b/test/e721-farms/camelotV3/CamelotV3Farm.t.sol index e0a738d6..c421667b 100644 --- a/test/e721-farms/camelotV3/CamelotV3Farm.t.sol +++ b/test/e721-farms/camelotV3/CamelotV3Farm.t.sol @@ -13,11 +13,11 @@ import { RewardTokenData, ICamelotV3Factory, ICamelotV3TickSpacing, - ICamelotV3Utils, INFPM, OperableDeposit, InitializeInput } from "../../../contracts/e721-farms/camelotV3/CamelotV3Farm.sol"; +import {ICamelotV3Utils} from "../../../contracts/e721-farms/camelotV3/interfaces/ICamelotV3Utils.sol"; import { ICamelotV3NFPMUtils, Position diff --git a/test/e721-farms/uniswapv3/UniV3Farm.t.sol b/test/e721-farms/uniswapv3/UniV3Farm.t.sol index dd1c08d0..55f91dd4 100644 --- a/test/e721-farms/uniswapv3/UniV3Farm.t.sol +++ b/test/e721-farms/uniswapv3/UniV3Farm.t.sol @@ -14,11 +14,11 @@ import { RewardTokenData, IUniswapV3Factory, IUniswapV3TickSpacing, - IUniswapV3Utils, INFPM, OperableDeposit, InitializeInput } from "../../../contracts/e721-farms/uniswapV3/UniV3Farm.sol"; +import {IUniswapV3Utils} from "../../../contracts/e721-farms/uniswapV3/interfaces/IUniswapV3Utils.sol"; import { INFPMUtils, Position From c735d35b1084cab80f4f733178751ee1f6b94135 Mon Sep 17 00:00:00 2001 From: arcantheon Date: Wed, 20 Mar 2024 17:28:27 +0530 Subject: [PATCH 9/9] Updated OZ dependencies --- brownie-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/brownie-config.yaml b/brownie-config.yaml index 9ffa4f68..d32a9f29 100644 --- a/brownie-config.yaml +++ b/brownie-config.yaml @@ -2,8 +2,8 @@ # https://eth-brownie.readthedocs.io/en/stable/config.html # required external contracts dependencies: - - OpenZeppelin/openzeppelin-contracts@4.7.3 - - OpenZeppelin/openzeppelin-contracts-upgradeable@4.7.3 + - OpenZeppelin/openzeppelin-contracts@5.0.2 + - OpenZeppelin/openzeppelin-contracts-upgradeable@5.0.2 - Uniswap/uniswap-v3-periphery@1.3.0 - Uniswap/uniswap-v3-core@1.0.0 @@ -14,13 +14,13 @@ pytest: revert_traceback: true compiler: solc: - version: 0.8.16 + version: 0.8.24 optimizer: enabled: true runs: 200 remappings: - - "@openzeppelin/contracts=OpenZeppelin/openzeppelin-contracts@4.7.3/contracts" - - "@openzeppelin/contracts-upgradeable=OpenZeppelin/openzeppelin-contracts-upgradeable@4.7.3/contracts" + - "@openzeppelin/contracts=OpenZeppelin/openzeppelin-contracts@5.0.2/contracts" + - "@openzeppelin/contracts-upgradeable=OpenZeppelin/openzeppelin-contracts-upgradeable@5.0.2/contracts" - "@uniswap/v3-periphery/contracts=Uniswap/uniswap-v3-periphery@1.3.0/contracts" - "@uniswap/v3-core/contracts=Uniswap/uniswap-v3-core@1.0.0/contracts"