From a2c4fea7f1366bf0ca72d90706c04c8d568fff2b Mon Sep 17 00:00:00 2001 From: Lifopam Date: Thu, 15 Oct 2026 12:51:47 +0300 Subject: [PATCH 1/6] fix verify scripts & outdated natspecs --- env.example | 1 - hardhat.base.config.ts | 7 +++---- .../contracts/interfaces/plugin/IAlgebraPlugin.sol | 3 +-- .../pool/IAlgebraPoolPermissionedActions.sol | 7 +++---- src/core/scripts/deploy.js | 1 + src/core/scripts/verify.js | 11 ++++++++--- src/periphery/contracts/interfaces/IQuoterV2.sol | 8 ++++---- src/periphery/scripts/verify.js | 11 ++++++++++- 8 files changed, 30 insertions(+), 19 deletions(-) diff --git a/env.example b/env.example index ba5b5f779..8e4f6679f 100644 --- a/env.example +++ b/env.example @@ -1,5 +1,4 @@ ETHERSCAN_API_KEY = ABSD123... -BSCSCAN_API_KEY = ABSD123... MNEMONIC = "one two three ..." INFURA_ID_PROJECT = "abcd1234..." diff --git a/hardhat.base.config.ts b/hardhat.base.config.ts index 4f29f5a71..617c1f5c8 100644 --- a/hardhat.base.config.ts +++ b/hardhat.base.config.ts @@ -1,7 +1,6 @@ const path = require('path'); const config = require('dotenv').config({ path: path.resolve(__dirname, '.env'), quiet: true }); -const { ETHERSCAN_API_KEY, BSCSCAN_API_KEY, POLYGONSCAN_API_KEY, MNEMONIC, DEPLOY_GAS_LIMIT_MAX, DEPLOY_GAS_PRICE, INFURA_ID_PROJECT } = - config.parsed || {}; +const { ETHERSCAN_API_KEY, MNEMONIC, DEPLOY_GAS_LIMIT_MAX, DEPLOY_GAS_PRICE, INFURA_ID_PROJECT } = config.parsed || {}; export default { networks: { @@ -105,9 +104,9 @@ export default { }, }, etherscan: { - // Your API key for Etherscan + // Your API key for Etherscan (v2 API, one for all chains) // Obtain one at https://etherscan.io/ - apiKey: `${POLYGONSCAN_API_KEY}`, + apiKey: `${ETHERSCAN_API_KEY}`, customChains: [ { network: 'seiTestnet', diff --git a/src/core/contracts/interfaces/plugin/IAlgebraPlugin.sol b/src/core/contracts/interfaces/plugin/IAlgebraPlugin.sol index 8c588d43a..a5af3292b 100644 --- a/src/core/contracts/interfaces/plugin/IAlgebraPlugin.sol +++ b/src/core/contracts/interfaces/plugin/IAlgebraPlugin.sol @@ -5,8 +5,7 @@ pragma solidity >=0.5.0; /// @dev The plugin will be called by the pool using hook methods depending on the current pool settings interface IAlgebraPlugin { /// @notice Returns plugin config - /// @return config Each bit of the config is responsible for enabling/disabling the hooks. - /// The last bit indicates whether the plugin contains dynamic fees logic + /// @return config Bitmap of enabled hooks and features, see `Plugins` function defaultPluginConfig() external view returns (uint16); /// @notice The hook called before the state of a pool is initialized diff --git a/src/core/contracts/interfaces/pool/IAlgebraPoolPermissionedActions.sol b/src/core/contracts/interfaces/pool/IAlgebraPoolPermissionedActions.sol index 45bd3e20c..fcbd6a9af 100644 --- a/src/core/contracts/interfaces/pool/IAlgebraPoolPermissionedActions.sol +++ b/src/core/contracts/interfaces/pool/IAlgebraPoolPermissionedActions.sol @@ -29,13 +29,12 @@ interface IAlgebraPoolPermissionedActions { function setPluginConfig(uint16 newConfig) external; /// @notice Set new community fee vault address. Only factory owner or POOLS_ADMINISTRATOR_ROLE role - /// @dev Community fee vault receives collected community fees. - /// **accumulated but not yet sent to the vault community fees once will be sent to the `newCommunityVault` address** + /// @dev The vault claims community fees with `claimCommunityFee`, unclaimed ones only by the `newCommunityVault`. + /// The zero address also sets the community fee to zero /// @param newCommunityVault The address of new community fee vault function setCommunityVault(address newCommunityVault) external; - /// @notice Set new pool fee. Can be called by owner if dynamic fee is disabled. - /// Called by the plugin if dynamic fee is enabled + /// @notice Set new pool fee if dynamic fee is disabled. Only factory owner or POOLS_ADMINISTRATOR_ROLE role /// @param newFee The new fee value function setFee(uint16 newFee) external; diff --git a/src/core/scripts/deploy.js b/src/core/scripts/deploy.js index 3714bb69c..723934d50 100644 --- a/src/core/scripts/deploy.js +++ b/src/core/scripts/deploy.js @@ -66,6 +66,7 @@ async function main() { deploysData.factory = factory.target; deploysData.poolExtension = await factory.poolExtension(); deploysData.vault = vault.target; + deploysData.algebraFeeManager = deployer.address; deploysData.vaultFactory = vaultFactoryStub.target; fs.writeFileSync(deployDataPath, JSON.stringify(deploysData), 'utf-8'); } diff --git a/src/core/scripts/verify.js b/src/core/scripts/verify.js index 5450618d8..94d66ecc1 100644 --- a/src/core/scripts/verify.js +++ b/src/core/scripts/verify.js @@ -6,8 +6,6 @@ async function main() { const deployDataPath = path.resolve(__dirname, '../../../deploys.json'); let deploysData = JSON.parse(fs.readFileSync(deployDataPath, 'utf8')); - const [deployer] = await hre.ethers.getSigners(); - await hre.run('verify:verify', { address: deploysData.factory, constructorArguments: [deploysData.poolDeployer], @@ -20,7 +18,14 @@ async function main() { await hre.run('verify:verify', { address: deploysData.vault, - constructorArguments: [deploysData.factory], + constructorArguments: [deploysData.factory, deploysData.algebraFeeManager], + }); + + // deployed by the factory in its constructor + await hre.run('verify:verify', { + contract: "contracts/AlgebraPoolExtension.sol:AlgebraPoolExtension", + address: deploysData.poolExtension, + constructorArguments: [], }); await hre.run('verify:verify', { diff --git a/src/periphery/contracts/interfaces/IQuoterV2.sol b/src/periphery/contracts/interfaces/IQuoterV2.sol index 5c55f38a4..35f949d02 100644 --- a/src/periphery/contracts/interfaces/IQuoterV2.sol +++ b/src/periphery/contracts/interfaces/IQuoterV2.sol @@ -18,7 +18,7 @@ interface IQuoterV2 { /// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path /// @return initializedTicksCrossedList List of the initialized ticks that the swap crossed for each pool in the path /// @return gasEstimate The estimate of the gas that the swap consumes - /// @return feeList List of the fee values used for swaps in the path + /// @return feeList The pool fees (`lastFee`), the applied ones may differ with dynamic fee function quoteExactInput( bytes memory path, uint256 amountInRequired @@ -52,7 +52,7 @@ interface IQuoterV2 { /// @return sqrtPriceX96After The sqrt price of the pool after the swap /// @return initializedTicksCrossed The number of initialized ticks that the swap crossed /// @return gasEstimate The estimate of the gas that the swap consumes - /// @return fee The fee value used for swap in the pool + /// @return fee The pool fee (`lastFee`), the applied one may differ with dynamic fee function quoteExactInputSingle( QuoteExactInputSingleParams memory params ) @@ -74,7 +74,7 @@ interface IQuoterV2 { /// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path /// @return initializedTicksCrossedList List of the initialized ticks that the swap crossed for each pool in the path /// @return gasEstimate The estimate of the gas that the swap consumes - /// @return feeList List of the fee values used for swaps in the path + /// @return feeList The pool fees (`lastFee`), the applied ones may differ with dynamic fee function quoteExactOutput( bytes memory path, uint256 amountOutRequired @@ -108,7 +108,7 @@ interface IQuoterV2 { /// @return sqrtPriceX96After The sqrt price of the pool after the swap /// @return initializedTicksCrossed The number of initialized ticks that the swap crossed /// @return gasEstimate The estimate of the gas that the swap consumes - /// @return fee The fee value used for swap in the pool + /// @return fee The pool fee (`lastFee`), the applied one may differ with dynamic fee function quoteExactOutputSingle( QuoteExactOutputSingleParams memory params ) diff --git a/src/periphery/scripts/verify.js b/src/periphery/scripts/verify.js index f02c1771a..b3510a7f9 100644 --- a/src/periphery/scripts/verify.js +++ b/src/periphery/scripts/verify.js @@ -50,10 +50,19 @@ async function main() { address: deploysData.proxy, constructorArguments: [ deploysData.nftDescriptor, - deploysData.admin, + deploysData.adminOwner, "0x" ], }); + + // deployed by the proxy in its constructor + await hre.run("verify:verify", { + contract: "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol:ProxyAdmin", + address: deploysData.admin, + constructorArguments: [ + deploysData.adminOwner + ], + }); await hre.run("verify:verify", { address: deploysData.nftDescriptor, From a7bb52054dc38d6439b7f4cf9bfb518c5cb83aaa Mon Sep 17 00:00:00 2001 From: Lifopam Date: Thu, 15 Oct 2026 13:59:11 +0300 Subject: [PATCH 2/6] clean up ci, configs and stale files, remove eslint --- .eslintignore | 6 - .eslintrc.cjs | 28 - .github/workflows/echidna_core.yml | 9 +- .github/workflows/echidna_farming.yml | 1 - .github/workflows/echidna_periphery.yml | 1 - .huskyrc.json | 5 - .prettierignore | 5 +- README.md | 2 + env.example | 3 - hardhat.base.config.ts | 83 +-- package-lock.json | 914 +----------------------- package.json | 5 - src/core/.eslintrc.cjs | 5 - src/core/echidna.assertion.yaml | 23 +- src/core/echidna.math.yaml | 16 +- src/core/echidna.property.yaml | 25 +- src/core/package-lock.json | 25 - src/farming/.eslintignore | 1 - src/farming/.eslintrc.cjs | 5 - src/farming/package.json | 1 - src/periphery/.eslintrc.cjs | 5 - src/periphery/.prettierrc | 3 +- src/periphery/package-lock.json | 93 --- 23 files changed, 47 insertions(+), 1217 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.cjs delete mode 100644 .huskyrc.json delete mode 100644 src/core/.eslintrc.cjs delete mode 100644 src/core/package-lock.json delete mode 100644 src/farming/.eslintignore delete mode 100644 src/farming/.eslintrc.cjs delete mode 100644 src/periphery/.eslintrc.cjs delete mode 100644 src/periphery/package-lock.json diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 1edf2a84f..000000000 --- a/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/dist -**/coverage -**/contracts -**/typechain -**/.eslintrc.cjs \ No newline at end of file diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 304ccb878..000000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint', 'unused-imports'], - extends: [ - // 'eslint:recommended', - // 'plugin:@typescript-eslint/recommended', - 'prettier', - ], - rules: { - '@typescript-eslint/no-unused-vars': 1, - '@typescript-eslint/no-floating-promises': 'error', - '@typescript-eslint/no-misused-promises': [ - 'error', - { - checksVoidReturn: false, - }, - ], - 'unused-imports/no-unused-imports-ts': 1, - 'no-shadow': 1, - 'no-dupe-else-if': 1, - 'no-dupe-keys': 1, - 'no-duplicate-imports': 1, - 'no-self-compare': 1, - 'no-self-assign': 1, - 'no-unreachable': 1, - }, -}; diff --git a/.github/workflows/echidna_core.yml b/.github/workflows/echidna_core.yml index 4531583b8..6be3d5a41 100644 --- a/.github/workflows/echidna_core.yml +++ b/.github/workflows/echidna_core.yml @@ -54,8 +54,7 @@ jobs: echidna-version: v2.3.3 files: ./src/core/contracts/test/echidna/PoolMockEchidna/${{ matrix.testName }}.sol contract: ${{ matrix.testName }} - crytic-args: --hardhat-ignore-compile - solc-args: --evm-version paris + solc-args: --evm-version cancun config: ./src/core/contracts/test/echidna/PoolMockEchidna/echidna-property.config.yml IntegrationAsserts: @@ -95,8 +94,7 @@ jobs: echidna-version: v2.3.3 files: ./src/core/contracts/test/echidna/PoolMockEchidna/${{ matrix.testName }}.sol contract: ${{ matrix.testName }} - crytic-args: --hardhat-ignore-compile - solc-args: --evm-version paris + solc-args: --evm-version cancun config: ./src/core/contracts/test/echidna/PoolMockEchidna/echidna-assert.config.yml UnitAsserts: @@ -144,6 +142,5 @@ jobs: echidna-version: v2.3.3 files: ./src/core/contracts/test/echidna/${{ matrix.testName }}.sol contract: ${{ matrix.testName }} - crytic-args: --hardhat-ignore-compile - solc-args: --evm-version paris + solc-args: --evm-version cancun config: ./src/core/contracts/test/echidna/echidna.config.yml diff --git a/.github/workflows/echidna_farming.yml b/.github/workflows/echidna_farming.yml index 79464f873..1c3494b34 100644 --- a/.github/workflows/echidna_farming.yml +++ b/.github/workflows/echidna_farming.yml @@ -53,5 +53,4 @@ jobs: files: ./src/farming/ contract: ${{ matrix.testName }} crytic-args: --hardhat-ignore-compile - solc-args: --evm-version paris config: ./src/farming/contracts/test/echidna/echidna.config.yml diff --git a/.github/workflows/echidna_periphery.yml b/.github/workflows/echidna_periphery.yml index 96e1fc842..894e98ca1 100644 --- a/.github/workflows/echidna_periphery.yml +++ b/.github/workflows/echidna_periphery.yml @@ -52,5 +52,4 @@ jobs: echidna-version: v2.3.3 files: ./src/periphery/ contract: ${{ matrix.testName }} - solc-args: --evm-version paris config: ./src/periphery/contracts/test/echidna/echidna.config.yml diff --git a/.huskyrc.json b/.huskyrc.json deleted file mode 100644 index 8e6b8741e..000000000 --- a/.huskyrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "hooks": { - "pre-commit": "lerna run precommit --concurrency 1 --stream" - } - } \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index 67b486826..938dcfd69 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,4 @@ -typechain/ \ No newline at end of file +typechain/ +# prettier-plugin-solidity fails on the comment in the empty interface body +src/core/contracts/interfaces/IAlgebraPool.sol +src/core/contracts/interfaces/IAlgebraPoolLegacy.sol diff --git a/README.md b/README.md index 89ca4aa58..15268aeb9 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,8 @@ $ npm run coverage ``` ## Deploy +The contracts are compiled for the Cancun EVM version (`MCOPY` opcode), so the network must support Cancun. + Firstly you need to create `.env` file in the root directory of project as in `env.example`. To deploy all modules in specific network: diff --git a/env.example b/env.example index 8e4f6679f..3e09fffa3 100644 --- a/env.example +++ b/env.example @@ -1,6 +1,3 @@ ETHERSCAN_API_KEY = ABSD123... MNEMONIC = "one two three ..." INFURA_ID_PROJECT = "abcd1234..." - -DEPLOY_GAS_LIMIT = 7000000 -DEPLOY_GAS_PRICE = 150 \ No newline at end of file diff --git a/hardhat.base.config.ts b/hardhat.base.config.ts index 617c1f5c8..8ac4882a4 100644 --- a/hardhat.base.config.ts +++ b/hardhat.base.config.ts @@ -1,6 +1,6 @@ const path = require('path'); const config = require('dotenv').config({ path: path.resolve(__dirname, '.env'), quiet: true }); -const { ETHERSCAN_API_KEY, MNEMONIC, DEPLOY_GAS_LIMIT_MAX, DEPLOY_GAS_PRICE, INFURA_ID_PROJECT } = config.parsed || {}; +const { ETHERSCAN_API_KEY, MNEMONIC, INFURA_ID_PROJECT } = config.parsed || {}; export default { networks: { @@ -21,23 +21,6 @@ export default { mainnet: { url: `https://mainnet.infura.io/v3/${INFURA_ID_PROJECT}`, }, - ropsten: { - url: `https://ropsten.infura.io/v3/${INFURA_ID_PROJECT}`, - chainId: 3, - accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], - }, - rinkeby: { - url: `https://rinkeby.infura.io/v3/${INFURA_ID_PROJECT}`, - }, - goerli: { - url: `https://goerli.infura.io/v3/${INFURA_ID_PROJECT}`, - }, - kovan: { - url: `https://kovan.infura.io/v3/${INFURA_ID_PROJECT}`, - chainId: 42, - accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], - gasPrice: 8000000000, - }, bscTestnet: { url: `https://data-seed-prebsc-2-s3.binance.org:8545`, chainId: 97, @@ -46,76 +29,28 @@ export default { bsc: { url: `https://bsc-dataseed3.binance.org`, }, - mumbai: { - url: `https://polygon-mumbai-bor.publicnode.com`, - chainId: 80001, - accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], - }, - mantleTestnet: { - url: `https://rpc.testnet.mantle.xyz`, - chainId: 5001, - accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], - }, mantle: { url: `https://rpc.mantle.xyz`, chainId: 5000, accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], }, - seiTestnet: { - url: `https://evm-rpc.arctic-1.seinetwork.io`, - chainId: 713715, - accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], - }, mode: { url: `https://mainnet.mode.network/`, chainId: 34443, accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], }, - holesky: { - url: `https://ethereum-holesky-rpc.publicnode.com`, - chainId: 17000, - accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], - }, - blastTestnet: { - url: `https://blast-sepolia.blockpi.network/v1/rpc/public`, - chainId: 168587773, - accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], - }, - telosTestnet: { - url: `https://testnet.telos.net/evm`, - chainId: 41, - accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], - }, - beraTestnet: { - url: `https://artio.rpc.berachain.com/`, - chainId: 80085, - accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], - }, maticMainnet: { url: `https://rpc-mainnet.matic.quiknode.pro`, chainId: 137, accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], gasPrice: 50_000_000_000, }, - artheraTestnet: { - url: `https://rpc-test.arthera.net`, - chainId: 10243, - accounts: [`0x${MNEMONIC || '1000000000000000000000000000000000000000000000000000000000000000'}`], - }, }, etherscan: { // Your API key for Etherscan (v2 API, one for all chains) // Obtain one at https://etherscan.io/ apiKey: `${ETHERSCAN_API_KEY}`, customChains: [ - { - network: 'seiTestnet', - chainId: 713715, - urls: { - apiURL: 'https://seitrace.com/api', - browserURL: 'https://seitrace.com/', - }, - }, { network: 'mode', chainId: 34443, @@ -124,14 +59,6 @@ export default { browserURL: 'https://explorer.mode.network/', }, }, - { - network: 'blastTestnet', - chainId: 168587773, - urls: { - apiURL: 'https://api-sepolia.blastscan.io/api', - browserURL: 'https://sepolia.blastscan.io/', - }, - }, { network: 'mantle', chainId: 5000, @@ -140,14 +67,6 @@ export default { browserURL: 'https://explorer.mantle.xyz/', }, }, - { - network: 'beraTestnet', - chainId: 80085, - urls: { - apiURL: 'https://api.routescan.io/v2/network/testnet/evm/80085/etherscan/api/', - browserURL: 'https://artio.beratrail.io/', - }, - }, ], }, }; diff --git a/package-lock.json b/package-lock.json index 432a93d84..b01a3c803 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,14 +10,9 @@ ], "devDependencies": { "@nomicfoundation/hardhat-toolbox": "^6.1.1", - "@typescript-eslint/eslint-plugin": "^8.46.2", - "@typescript-eslint/parser": "^8.46.2", "bignumber.js": "^9.3.1", "decimal.js": "^10.6.0", "dotenv": "^17.2.3", - "eslint": "^9.17.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-unused-imports": "^4.3.0", "hardhat": "^2.29.1", "hardhat-contract-sizer": "^2.10.1", "hardhat-dependency-compiler": "^1.2.1", @@ -659,195 +654,6 @@ "tslib": "^2.4.0" } }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", - "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", - "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/config-array": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", - "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/object-schema": "^2.1.7", - "debug": "^4.3.1", - "minimatch": "^3.1.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/config-array/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@eslint/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/@eslint/config-helpers": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", - "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^0.17.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/core": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", - "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", - "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@eslint/eslintrc/node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/@eslint/js": { - "version": "9.39.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.0.tgz", - "integrity": "sha512-BIhe0sW91JGPiaF1mOuPy5v8NflqfjIcDNpC+LbW9f609WVRX1rArrhi6Z2ymvrAry9jw+5POTj4t2t62o8Bmw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - } - }, - "node_modules/@eslint/object-schema": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", - "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/plugin-kit": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", - "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^0.17.0", - "levn": "^0.4.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, "node_modules/@ethereumjs/rlp": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.2.tgz", @@ -1396,44 +1202,6 @@ "node": ">=14" } }, - "node_modules/@humanfs/core": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", - "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanfs/node": { - "version": "0.16.7", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", - "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanfs/core": "^0.19.1", - "@humanwhocodes/retry": "^0.4.0" - }, - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, "node_modules/@humanwhocodes/momoa": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.4.tgz", @@ -1444,20 +1212,6 @@ "node": ">=10.10.0" } }, - "node_modules/@humanwhocodes/retry": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", - "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, "node_modules/@hutson/parse-repository-url": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz", @@ -2713,6 +2467,7 @@ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -2727,6 +2482,7 @@ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 8" } @@ -2737,6 +2493,7 @@ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -4904,13 +4661,6 @@ "@types/chai": "*" } }, - "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -4967,13 +4717,6 @@ "@types/istanbul-lib-report": "*" } }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", @@ -5064,256 +4807,8 @@ "version": "21.0.3", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.46.2.tgz", - "integrity": "sha512-ZGBMToy857/NIPaaCucIUQgqueOiq7HeAKkhlvqVV4lm089zUFW6ikRySx2v+cAhKeUCPuWVHeimyk6Dw1iY3w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.46.2", - "@typescript-eslint/type-utils": "8.46.2", - "@typescript-eslint/utils": "8.46.2", - "@typescript-eslint/visitor-keys": "8.46.2", - "graphemer": "^1.4.0", - "ignore": "^7.0.0", - "natural-compare": "^1.4.0", - "ts-api-utils": "^2.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^8.46.2", - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.46.2.tgz", - "integrity": "sha512-BnOroVl1SgrPLywqxyqdJ4l3S2MsKVLDVxZvjI1Eoe8ev2r3kGDo+PcMihNmDE+6/KjkTubSJnmqGZZjQSBq/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/scope-manager": "8.46.2", - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/typescript-estree": "8.46.2", - "@typescript-eslint/visitor-keys": "8.46.2", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/project-service": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.46.2.tgz", - "integrity": "sha512-PULOLZ9iqwI7hXcmL4fVfIsBi6AN9YxRc0frbvmg8f+4hQAjQ5GYNKK0DIArNo+rOKmR/iBYwkpBmnIwin4wBg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.46.2", - "@typescript-eslint/types": "^8.46.2", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.46.2.tgz", - "integrity": "sha512-LF4b/NmGvdWEHD2H4MsHD8ny6JpiVNDzrSZr3CsckEgCbAGZbYM4Cqxvi9L+WqDMT+51Ozy7lt2M+d0JLEuBqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/visitor-keys": "8.46.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.46.2.tgz", - "integrity": "sha512-a7QH6fw4S57+F5y2FIxxSDyi5M4UfGF+Jl1bCGd7+L4KsaUY80GsiF/t0UoRFDHAguKlBaACWJRmdrc6Xfkkag==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.46.2.tgz", - "integrity": "sha512-HbPM4LbaAAt/DjxXaG9yiS9brOOz6fabal4uvUmaUYe6l3K1phQDMQKBRUrr06BQkxkvIZVVHttqiybM9nJsLA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/typescript-estree": "8.46.2", - "@typescript-eslint/utils": "8.46.2", - "debug": "^4.3.4", - "ts-api-utils": "^2.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.2.tgz", - "integrity": "sha512-lNCWCbq7rpg7qDsQrd3D6NyWYu+gkTENkG5IKYhUIcxSb59SQC/hEQ+MrG4sTgBVghTonNWq42bA/d4yYumldQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.46.2.tgz", - "integrity": "sha512-f7rW7LJ2b7Uh2EiQ+7sza6RDZnajbNbemn54Ob6fRwQbgcIn+GWfyuHDHRYgRoZu1P4AayVScrRW+YfbTvPQoQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/project-service": "8.46.2", - "@typescript-eslint/tsconfig-utils": "8.46.2", - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/visitor-keys": "8.46.2", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^2.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.46.2.tgz", - "integrity": "sha512-sExxzucx0Tud5tE0XqR0lT0psBQvEpnpiul9XbGUB1QwpWJJAps1O/Z7hJxLGiZLBKMCutjTzDgmd1muEhBnVg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.46.2", - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/typescript-estree": "8.46.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.46.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.46.2.tgz", - "integrity": "sha512-tUFMXI4gxzzMXt4xpGJEsBsTox0XbNQ1y94EwlD/CuZwFcQP79xfQqMhau9HsRc/J0cAPA/HZt1dZPtGn9V/7w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.46.2", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } + "dev": true, + "license": "MIT" }, "node_modules/@yarnpkg/lockfile": { "version": "1.1.0", @@ -5433,16 +4928,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, "node_modules/acorn-walk": { "version": "8.3.4", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", @@ -7434,7 +6919,8 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/defaults": { "version": "1.0.4", @@ -7981,206 +7467,6 @@ "node": ">= 0.8.0" } }, - "node_modules/eslint": { - "version": "9.39.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.0.tgz", - "integrity": "sha512-iy2GE3MHrYTL5lrCtMZ0X1KLEKKUjmK0kzwcnefhR66txcEmXZD2YWgR5GNdcEwkNx3a0siYkSvl0vIC+Svjmg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.8.0", - "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.1", - "@eslint/config-helpers": "^0.4.2", - "@eslint/core": "^0.17.0", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.39.0", - "@eslint/plugin-kit": "^0.4.1", - "@humanfs/node": "^0.16.6", - "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.2", - "@types/estree": "^1.0.6", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.6", - "debug": "^4.3.2", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.4.0", - "eslint-visitor-keys": "^4.2.1", - "espree": "^10.4.0", - "esquery": "^1.5.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "jiti": "*" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - } - } - }, - "node_modules/eslint-config-prettier": { - "version": "10.1.8", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", - "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", - "dev": true, - "license": "MIT", - "bin": { - "eslint-config-prettier": "bin/cli.js" - }, - "funding": { - "url": "https://opencollective.com/eslint-config-prettier" - }, - "peerDependencies": { - "eslint": ">=7.0.0" - } - }, - "node_modules/eslint-plugin-unused-imports": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.3.0.tgz", - "integrity": "sha512-ZFBmXMGBYfHttdRtOG9nFFpmUvMtbHSjsKrS20vdWdbfiVYsO3yA2SGYy9i9XmZJDfMGBflZGBCm70SEnFQtOA==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0", - "eslint": "^9.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "@typescript-eslint/eslint-plugin": { - "optional": true - } - } - }, - "node_modules/eslint-scope": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", - "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/espree": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", - "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.15.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/esprima": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", @@ -8196,48 +7482,13 @@ "node": ">=0.10.0" } }, - "node_modules/esquery": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -8598,6 +7849,7 @@ "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -8615,6 +7867,7 @@ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -8634,7 +7887,8 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fast-uri": { "version": "3.1.0", @@ -8659,6 +7913,7 @@ "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "reusify": "^1.0.4" } @@ -8699,19 +7954,6 @@ "node": ">=0.8.0" } }, - "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "flat-cache": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, "node_modules/filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", @@ -8796,27 +8038,6 @@ "flat": "cli.js" } }, - "node_modules/flat-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", - "dev": true, - "license": "MIT", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/flatted": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", - "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", - "dev": true, - "license": "ISC" - }, "node_modules/follow-redirects": { "version": "1.15.11", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", @@ -9497,19 +8718,6 @@ "which": "bin/which" } }, - "node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/globby": { "version": "10.0.2", "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", @@ -9601,13 +8809,6 @@ "dev": true, "license": "ISC" }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true, - "license": "MIT" - }, "node_modules/handlebars": { "version": "4.7.8", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", @@ -11640,13 +10841,6 @@ "dev": true, "license": "MIT" }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "license": "MIT" - }, "node_modules/json-stream-stringify": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/json-stream-stringify/-/json-stream-stringify-3.1.6.tgz", @@ -12082,20 +11276,6 @@ "node": ">=6" } }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/libnpmaccess": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-10.0.1.tgz", @@ -12492,13 +11672,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "license": "MIT" - }, "node_modules/lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", @@ -12938,6 +12111,7 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 8" } @@ -14342,24 +13516,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "dev": true, - "license": "MIT", - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/ora": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/ora/-/ora-5.3.0.tgz", @@ -15264,16 +14420,6 @@ "node": ">=4" } }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/prettier": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", @@ -15536,7 +14682,8 @@ "url": "https://feross.org/support" } ], - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/quick-lru": { "version": "4.0.1", @@ -16132,6 +15279,7 @@ "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -16215,6 +15363,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "queue-microtask": "^1.2.2" } @@ -17891,19 +17040,6 @@ "node": ">=8" } }, - "node_modules/ts-api-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", - "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.12" - }, - "peerDependencies": { - "typescript": ">=4.8.4" - } - }, "node_modules/ts-command-line-args": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz", @@ -18104,19 +17240,6 @@ "node": "^18.17.0 || >=20.5.0" } }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/type-detect": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", @@ -18795,6 +17918,7 @@ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } diff --git a/package.json b/package.json index 346184ec7..2ddecb91a 100644 --- a/package.json +++ b/package.json @@ -6,14 +6,9 @@ ], "devDependencies": { "@nomicfoundation/hardhat-toolbox": "^6.1.1", - "@typescript-eslint/eslint-plugin": "^8.46.2", - "@typescript-eslint/parser": "^8.46.2", "bignumber.js": "^9.3.1", "decimal.js": "^10.6.0", "dotenv": "^17.2.3", - "eslint": "^9.17.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-unused-imports": "^4.3.0", "hardhat": "^2.29.1", "hardhat-contract-sizer": "^2.10.1", "hardhat-dependency-compiler": "^1.2.1", diff --git a/src/core/.eslintrc.cjs b/src/core/.eslintrc.cjs deleted file mode 100644 index d4c034a56..000000000 --- a/src/core/.eslintrc.cjs +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - parserOptions: { - project: 'tsconfig.json', - }, -}; diff --git a/src/core/echidna.assertion.yaml b/src/core/echidna.assertion.yaml index bf0a909b3..0c5571557 100644 --- a/src/core/echidna.assertion.yaml +++ b/src/core/echidna.assertion.yaml @@ -1,22 +1,14 @@ -# Assertion mode for the stateful suites: every `assert` inside the wrapper functions is a property. -# The stateless math libraries use echidna.math.yaml instead, which runs one call per sequence. -# -# echidna . --contract AssertFeeModeSwapEchidnaTest --config echidna.assertion.yaml -# echidna . --contract AssertSwapEchidnaTest --config echidna.assertion.yaml -# echidna . --contract AssertDeltasEchidnaTest --config echidna.assertion.yaml -# -# IMPORTANT: run `npx hardhat clean && npx hardhat compile` before a campaign, not a plain recompile. -# Hardhat keeps old build-info files around on an incremental build and crytic-compile reads all of them, -# so a stale copy of a test contract can be the one that actually gets fuzzed. The symptom is a counterexample -# that contradicts a `require` in the current source. +# Assertion mode for the stateful pool suites. Run per file as in CI, `echidna .` fails on them (crytic/echidna#1118): +# echidna contracts/test/echidna/PoolMockEchidna/AssertSwapEchidnaTest.sol --contract AssertSwapEchidnaTest \ +# --config echidna.assertion.yaml --solc-args '--evm-version cancun' +# The same for AssertFeeModeSwapEchidnaTest and AssertDeltasEchidnaTest testMode: assertion testLimit: 500000 seqLen: 50 shrinkLimit: 5000 -# The solvency check drains the positions it tracks, so positions it cannot see must not exist: the raw `mint` -# stays out. The entry names the contract under test, as a bare signature is silently ignored +# the solvency check sees only the tracked positions, so the raw `mint` is excluded; a bare signature is ignored filterFunctions: ["AssertFeeModeSwapEchidnaTest.mint(address,address,int24,int24,uint128,bytes)"] filterBlacklist: true @@ -24,11 +16,8 @@ filterBlacklist: true balanceContract: 0 balanceAddr: 0 -# the pool mocks inherit the full AlgebraPool and exceed the 24576 byte mainnet limit, -# so the deploy-time code size check has to be lifted +# the pool mocks exceed the 24576 byte code size limit codeSize: 0xffffffff corpusDir: echidna-corpus-assertion coverage: true - -cryticArgs: ['--hardhat-ignore-compile'] diff --git a/src/core/echidna.math.yaml b/src/core/echidna.math.yaml index 39fa6d682..443f130ee 100644 --- a/src/core/echidna.math.yaml +++ b/src/core/echidna.math.yaml @@ -1,17 +1,7 @@ -# Assertion mode for the stateless math libraries. -# -# Every function in these contracts is `pure`, so a call tells us nothing about the next one: a long sequence -# is just wasted budget, since `testLimit` counts transactions rather than sequences. With `seqLen: 1` every -# transaction is an independent test case and shrinking has a single call to minimise instead of fifty. -# +# Assertion mode for the stateless math libraries: the calls are independent, so `seqLen: 1` # echidna . --contract PriceMovementMathEchidnaTest --config echidna.math.yaml --workers 4 -# echidna . --contract TokenDeltaMathEchidnaTest --config echidna.math.yaml --workers 4 -# echidna . --contract FullMathEchidnaTest --config echidna.math.yaml --workers 4 -# -# IMPORTANT: run `npx hardhat clean && npx hardhat compile` before a campaign, not a plain recompile. -# Hardhat keeps old build-info files around on an incremental build and crytic-compile reads all of them, -# so a stale copy of a test contract can be the one that actually gets fuzzed. The symptom is a counterexample -# that contradicts a `require` in the current source. +# The same for TokenDeltaMathEchidnaTest and FullMathEchidnaTest. Before a campaign run +# `npx hardhat clean && npx hardhat compile`: crytic-compile also reads the stale build-info of incremental builds testMode: assertion testLimit: 2000000 diff --git a/src/core/echidna.property.yaml b/src/core/echidna.property.yaml index bcb1584d5..8e972513b 100644 --- a/src/core/echidna.property.yaml +++ b/src/core/echidna.property.yaml @@ -1,23 +1,15 @@ -# Property mode: every `echidna_*` view function must keep returning true. -# Used for the stateful pool invariants. -# -# echidna . --contract PropFeeTokenIsolationEchidnaTest --config echidna.property.yaml -# echidna . --contract PropReservesEchidnaTest --config echidna.property.yaml -# echidna . --contract PropBalancesEchidnaTest --config echidna.property.yaml -# -# IMPORTANT: run `npx hardhat clean && npx hardhat compile` before a campaign, not a plain recompile. -# Hardhat keeps old build-info files around on an incremental build and crytic-compile reads all of them, -# so a stale copy of a test contract can be the one that actually gets fuzzed. The symptom is a counterexample -# that contradicts a `require` in the current source. +# Property mode for the stateful pool suites. Run per file as in CI, `echidna .` fails on them (crytic/echidna#1118): +# echidna contracts/test/echidna/PoolMockEchidna/PropReservesEchidnaTest.sol --contract PropReservesEchidnaTest \ +# --config echidna.property.yaml --solc-args '--evm-version cancun' +# The same for PropBalancesEchidnaTest and PropFeeTokenIsolationEchidnaTest testMode: property testLimit: 500000 seqLen: 100 shrinkLimit: 5000 -# The fee token is pinned per suite, so the setters that could move it and the raw `flash`, which pays fees in both tokens, stay out. -# The entry has to name the contract under test even though both functions are inherited: a bare signature, -# or the declaring contract, is silently ignored. Entries that match nothing are harmless for the other suites +# the fee token is pinned, so the fee mode setters and `flash` (fees in both tokens) are excluded; +# the entries must name the contract under test, the other suites ignore them filterFunctions: ["PropFeeTokenIsolationEchidnaTest.setFeeMode(uint8)", "PropFeeTokenIsolationEchidnaTest.setFeeModeWrapped(uint8)", "PropFeeTokenIsolationEchidnaTest.flash(address,uint256,uint256,bytes)"] filterBlacklist: true @@ -25,11 +17,8 @@ filterBlacklist: true balanceContract: 0 balanceAddr: 0 -# the pool mocks inherit the full AlgebraPool and exceed the 24576 byte mainnet limit, -# so the deploy-time code size check has to be lifted +# the pool mocks exceed the 24576 byte code size limit codeSize: 0xffffffff corpusDir: echidna-corpus-property coverage: true - -cryticArgs: ['--hardhat-ignore-compile'] diff --git a/src/core/package-lock.json b/src/core/package-lock.json deleted file mode 100644 index ffedc038a..000000000 --- a/src/core/package-lock.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@cryptoalgebra/integral-core", - "version": "1.2.5", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@cryptoalgebra/integral-core", - "version": "1.2.5", - "license": "GPL-2.0-or-later", - "dependencies": { - "@openzeppelin/contracts": "4.9.3" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=8.0.0" - } - }, - "node_modules/@openzeppelin/contracts": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.3.tgz", - "integrity": "sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==" - } - } -} diff --git a/src/farming/.eslintignore b/src/farming/.eslintignore deleted file mode 100644 index 7fa38cee5..000000000 --- a/src/farming/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -test/shared/external/v3-periphery/ \ No newline at end of file diff --git a/src/farming/.eslintrc.cjs b/src/farming/.eslintrc.cjs deleted file mode 100644 index d4c034a56..000000000 --- a/src/farming/.eslintrc.cjs +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - parserOptions: { - project: 'tsconfig.json', - }, -}; diff --git a/src/farming/package.json b/src/farming/package.json index 127bbcc64..696832f92 100644 --- a/src/farming/package.json +++ b/src/farming/package.json @@ -34,7 +34,6 @@ }, "scripts": { "compile": "npm --prefix ../periphery run compile && hardhat compile", - "lint": "eslint . --ext .ts", "size-contracts": "hardhat compile && hardhat size-contracts", "solhint": "solhint --config ../../.solhint.json \"contracts/**/*.sol\"", "test": "hardhat test --parallel", diff --git a/src/periphery/.eslintrc.cjs b/src/periphery/.eslintrc.cjs deleted file mode 100644 index d4c034a56..000000000 --- a/src/periphery/.eslintrc.cjs +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - parserOptions: { - project: 'tsconfig.json', - }, -}; diff --git a/src/periphery/.prettierrc b/src/periphery/.prettierrc index a648a73cb..e109f22f7 100644 --- a/src/periphery/.prettierrc +++ b/src/periphery/.prettierrc @@ -2,5 +2,6 @@ "plugins": ["prettier-plugin-solidity"], "semi": true, "singleQuote": true, - "printWidth": 120 + "printWidth": 120, + "overrides": [{ "files": "*.sol", "options": { "compiler": "0.8.26" } }] } diff --git a/src/periphery/package-lock.json b/src/periphery/package-lock.json deleted file mode 100644 index 8b227cfaf..000000000 --- a/src/periphery/package-lock.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "name": "@cryptoalgebra/integral-periphery", - "version": "1.2.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@cryptoalgebra/integral-periphery", - "version": "1.2.1", - "license": "GPL-2.0-or-later", - "dependencies": { - "@cryptoalgebra/integral-core": "1.2.1", - "@openzeppelin/contracts": "4.9.3", - "@uniswap/v2-core": "1.0.1" - }, - "devDependencies": { - "is-svg": "^4.3.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=8.0.0" - } - }, - "node_modules/@cryptoalgebra/integral-core": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@cryptoalgebra/integral-core/-/integral-core-1.2.1.tgz", - "integrity": "sha512-+Lj7y2ZqpJ58fNtqTRvrMv/HPcyqNkMpINu9LQK6/iMDePmzNoywogLLiGU34MlxAaGEwO6XNWM7ENq/YzzZzA==", - "dependencies": { - "@openzeppelin/contracts": "4.9.3" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=8.0.0" - } - }, - "node_modules/@openzeppelin/contracts": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.3.tgz", - "integrity": "sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==" - }, - "node_modules/@uniswap/v2-core": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@uniswap/v2-core/-/v2-core-1.0.1.tgz", - "integrity": "sha512-MtybtkUPSyysqLY2U210NBDeCHX+ltHt3oADGdjqoThZaFRDKwM6k1Nb3F0A3hk5hwuQvytFWhrWHOEq6nVJ8Q==", - "engines": { - "node": ">=10" - } - }, - "node_modules/fast-xml-parser": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.4.tgz", - "integrity": "sha512-utnwm92SyozgA3hhH2I8qldf2lBqm6qHOICawRNRFu1qMe3+oqr+GcXjGqTmXTMGE5T4eC03kr/rlh5C1IRdZA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - }, - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" - } - ], - "dependencies": { - "strnum": "^1.0.5" - }, - "bin": { - "fxparser": "src/cli/cli.js" - } - }, - "node_modules/is-svg": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-4.4.0.tgz", - "integrity": "sha512-v+AgVwiK5DsGtT9ng+m4mClp6zDAmwrW8nZi6Gg15qzvBnRWWdfWA1TGaXyCDnWq5g5asofIgMVl3PjKxvk1ug==", - "dev": true, - "dependencies": { - "fast-xml-parser": "^4.1.3" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/strnum": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", - "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", - "dev": true - } - } -} From b777330c0add5e5331c063157ce80cb78aabbeb8 Mon Sep 17 00:00:00 2001 From: Lifopam Date: Thu, 15 Oct 2026 14:02:19 +0300 Subject: [PATCH 3/6] shorten comments in pool contracts --- src/core/contracts/AlgebraPool.sol | 92 ++++++++++--------- src/core/contracts/AlgebraPoolExtension.sol | 71 +++++++++----- src/core/contracts/base/SwapCalculation.sol | 14 ++- .../interfaces/pool/IAlgebraPoolEvents.sol | 8 +- 4 files changed, 111 insertions(+), 74 deletions(-) diff --git a/src/core/contracts/AlgebraPool.sol b/src/core/contracts/AlgebraPool.sol index 61cee9c19..77dbd324c 100644 --- a/src/core/contracts/AlgebraPool.sol +++ b/src/core/contracts/AlgebraPool.sol @@ -19,7 +19,6 @@ import './libraries/Plugins.sol'; import './interfaces/plugin/IAlgebraPlugin.sol'; import './interfaces/IAlgebraFactory.sol'; - /// @title Algebra concentrated liquidity pool /// @notice This contract is responsible for liquidity positions, swaps and flashloans /// @dev Version: Algebra Integral 1.3 @@ -30,7 +29,9 @@ contract AlgebraPool is AlgebraPoolBase, TickStructure, ReentrancyGuard, Positio using Plugins for bytes4; /// @inheritdoc IAlgebraPoolActions - function initialize(uint160) external override { _delegateToExtension(); } + function initialize(uint160) external override { + _delegateToExtension(); + } /// @inheritdoc IAlgebraPoolActions function mint( @@ -141,13 +142,7 @@ contract AlgebraPool is AlgebraPoolBase, TickStructure, ReentrancyGuard, Positio return msg.sender == plugin; } - function _beforeModifyPos( - address owner, - int24 bottomTick, - int24 topTick, - int128 liquidityDelta, - bytes calldata data - ) internal { + function _beforeModifyPos(address owner, int24 bottomTick, int24 topTick, int128 liquidityDelta, bytes calldata data) internal { if (globalState.pluginConfig.hasFlag(Plugins.BEFORE_POSITION_MODIFY_FLAG)) { if (_isPlugin()) return; bytes4 selector = IAlgebraPlugin(plugin).beforeModifyPosition(msg.sender, owner, bottomTick, topTick, liquidityDelta, data); @@ -226,9 +221,7 @@ contract AlgebraPool is AlgebraPoolBase, TickStructure, ReentrancyGuard, Positio ) external override returns (int256 amount0, int256 amount1) { SwapCache memory _cache = SwapCache(recipient, zeroToOne, amountRequired, limitSqrtPrice, data, 0, 0); - // amountInDecrease is either in token0 or token1 depending on zeroToOne - // can only be non-zero if exactIn! - // can only decrease the input token affecting the amount passed to the swap calculation + // amountInDecrease is the plugin part of the input (exactIn only), it is not swapped (_cache.amountInDecrease, _cache.fee) = _beforeSwap( _cache.recipient, _cache.zeroToOne, @@ -249,9 +242,7 @@ contract AlgebraPool is AlgebraPoolBase, TickStructure, ReentrancyGuard, Positio _cache.limitSqrtPrice ); - // amountInIncrease, amountOutDecrease is either in token0 or token1 respectively depending on zeroToOne - // can only increase the input (for the exactOut case) - // can only decrease the output (for the exactIn case) + // the plugin parts: amountInIncrease is added to the input (exactOut only), amountOutDecrease is taken from the output (exactIn only) (uint256 amountInIncrease, uint256 amountOutDecrease) = _afterSwapCalculation( _cache.recipient, _cache.zeroToOne, @@ -265,12 +256,9 @@ contract AlgebraPool is AlgebraPoolBase, TickStructure, ReentrancyGuard, Positio (uint256 balance0Before, uint256 balance1Before) = _updateReserves(); if (_cache.zeroToOne) { - // These amounts are representing pool <-> user payments - // Increase because amount1 is negative. It makes the pool send less to the user + // the amounts become the user payments: the plugin deltas lower the output (negative) and raise the input amount1 += int256(amountOutDecrease); - // Increase amount0. It makes the user send more to the pool (this excess part will go to a plugin) - // amountInIncrease (exactOut) or amountInDecrease (exactIn), only one of them can be non-zero - uint256 pluginAmountIn = amountInIncrease + _cache.amountInDecrease; + uint256 pluginAmountIn = amountInIncrease + _cache.amountInDecrease; // at most one of them is non-zero amount0 += int256(pluginAmountIn); unchecked { if (amount1 < 0) _transfer(token1, _cache.recipient, uint256(-amount1)); // amount1 cannot be > 0 @@ -279,16 +267,13 @@ contract AlgebraPool is AlgebraPoolBase, TickStructure, ReentrancyGuard, Positio if (balance0Before + uint256(amount0) > _balanceToken0()) revert insufficientInputAmount(); _transferToPlugin(token0, token1, pluginAmountIn, amountOutDecrease); - // reflect reserve change and accumulate communityFee + // the reserves change by the swapped amounts, without the plugin deltas if (fees.inToken0) _changeReserves(amount0 - int256(pluginAmountIn), amount1 - int256(amountOutDecrease), fees.communityFeeAmount, 0); else _changeReserves(amount0 - int256(pluginAmountIn), amount1 - int256(amountOutDecrease), 0, fees.communityFeeAmount); } else { - // These amounts are representing pool <-> user payments - // Increase because amount0 is negative. It makes the pool send less to the user + // the amounts become the user payments: the plugin deltas lower the output (negative) and raise the input amount0 += int256(amountOutDecrease); - // Increase amount1. It makes the user send more to the pool (this excess part will go to a plugin) - // amountInIncrease (exactOut) or amountInDecrease (exactIn), only one of them can be non-zero - uint256 pluginAmountIn = amountInIncrease + _cache.amountInDecrease; + uint256 pluginAmountIn = amountInIncrease + _cache.amountInDecrease; // at most one of them is non-zero amount1 += int256(pluginAmountIn); unchecked { @@ -298,12 +283,16 @@ contract AlgebraPool is AlgebraPoolBase, TickStructure, ReentrancyGuard, Positio if (balance1Before + uint256(amount1) > _balanceToken1()) revert insufficientInputAmount(); _transferToPlugin(token1, token0, pluginAmountIn, amountOutDecrease); - // reflect reserve change and accumulate communityFee + // the reserves change by the swapped amounts, without the plugin deltas if (fees.inToken0) _changeReserves(amount0 - int256(amountOutDecrease), amount1 - int256(pluginAmountIn), fees.communityFeeAmount, 0); else _changeReserves(amount0 - int256(amountOutDecrease), amount1 - int256(pluginAmountIn), 0, fees.communityFeeAmount); } - (eventParams.fee, eventParams.pluginAmountIn, eventParams.pluginAmountOut) = (_cache.fee, amountInIncrease + _cache.amountInDecrease, amountOutDecrease); + (eventParams.fee, eventParams.pluginAmountIn, eventParams.pluginAmountOut) = ( + _cache.fee, + amountInIncrease + _cache.amountInDecrease, + amountOutDecrease + ); _emitSwapEvent(_cache.recipient, amount0, amount1, eventParams); } @@ -368,28 +357,24 @@ contract AlgebraPool is AlgebraPoolBase, TickStructure, ReentrancyGuard, Positio // the pool keeps only the swapped amounts, the plugin deltas are not swapped // the fees are in the fee token, not necessarily the input one if (zeroToOne) { - // reflect reserve change and accumulate communityFee if (fees.inToken0) _changeReserves(amount0 - amountToSell, amount1, fees.communityFeeAmount, 0); else _changeReserves(amount0 - amountToSell, amount1, 0, fees.communityFeeAmount); - // These amounts are representing pool <-> user payments, as in `swap` + // the amounts become the user payments, as in `swap` (amount0, amount1) = (amount0 + int256(amountInDecrease), amount1 + int256(amountOutDecrease)); - // transfer to the recipient and return the leftovers if (amount1 < 0) _transfer(token1, recipient, uint256(-amount1)); // amount1 cannot be > 0 uint256 leftover = uint256(amountToSell - amount0); if (leftover != 0) _transfer(token0, leftoversRecipient, leftover); _transferToPlugin(token0, token1, amountInDecrease, amountOutDecrease); } else { - // reflect reserve change and accumulate communityFee if (fees.inToken0) _changeReserves(amount0, amount1 - amountToSell, fees.communityFeeAmount, 0); else _changeReserves(amount0, amount1 - amountToSell, 0, fees.communityFeeAmount); - // These amounts are representing pool <-> user payments, as in `swap` + // the amounts become the user payments, as in `swap` (amount0, amount1) = (amount0 + int256(amountOutDecrease), amount1 + int256(amountInDecrease)); - // transfer to the recipient and return the leftovers if (amount0 < 0) _transfer(token0, recipient, uint256(-amount0)); // amount0 cannot be > 0 uint256 leftover = uint256(amountToSell - amount1); if (leftover != 0) _transfer(token1, leftoversRecipient, leftover); @@ -491,7 +476,16 @@ contract AlgebraPool is AlgebraPoolBase, TickStructure, ReentrancyGuard, Positio } } - function _afterSwap(address recipient, bool zto, int256 amount, uint160 limitPrice, int256 amount0, int256 amount1, uint256 feeAmount, bytes calldata data) internal { + function _afterSwap( + address recipient, + bool zto, + int256 amount, + uint160 limitPrice, + int256 amount0, + int256 amount1, + uint256 feeAmount, + bytes calldata data + ) internal { if (globalState.pluginConfig.hasFlag(Plugins.AFTER_SWAP_FLAG)) { if (_isPlugin()) return; IAlgebraPlugin(plugin).afterSwap(msg.sender, recipient, zto, amount, limitPrice, amount0, amount1, feeAmount, data).shouldReturn( @@ -556,25 +550,39 @@ contract AlgebraPool is AlgebraPoolBase, TickStructure, ReentrancyGuard, Positio // Setters are called rarely, so the additional gas overhead of delegatecall is acceptable /// @inheritdoc IAlgebraPoolPermissionedActions - function setCommunityFee(uint16) external override { _delegateToExtension(); } + function setCommunityFee(uint16) external override { + _delegateToExtension(); + } /// @inheritdoc IAlgebraPoolPermissionedActions - function setFeeMode(uint8) external override { _delegateToExtension(); } + function setFeeMode(uint8) external override { + _delegateToExtension(); + } /// @inheritdoc IAlgebraPoolPermissionedActions - function setTickSpacing(int24) external override { _delegateToExtension(); } + function setTickSpacing(int24) external override { + _delegateToExtension(); + } /// @inheritdoc IAlgebraPoolPermissionedActions - function setPlugin(address) external override { _delegateToExtension(); } + function setPlugin(address) external override { + _delegateToExtension(); + } /// @inheritdoc IAlgebraPoolPermissionedActions - function setPluginConfig(uint16) external override { _delegateToExtension(); } + function setPluginConfig(uint16) external override { + _delegateToExtension(); + } /// @inheritdoc IAlgebraPoolPermissionedActions - function setCommunityVault(address) external override { _delegateToExtension(); } + function setCommunityVault(address) external override { + _delegateToExtension(); + } /// @inheritdoc IAlgebraPoolPermissionedActions - function setFee(uint16) external override { _delegateToExtension(); } + function setFee(uint16) external override { + _delegateToExtension(); + } /// @dev using function to save bytecode function _checkIfPlugin() private view { diff --git a/src/core/contracts/AlgebraPoolExtension.sol b/src/core/contracts/AlgebraPoolExtension.sol index 72b09b3d0..792474336 100644 --- a/src/core/contracts/AlgebraPoolExtension.sol +++ b/src/core/contracts/AlgebraPoolExtension.sol @@ -14,18 +14,15 @@ import './interfaces/plugin/IAlgebraPlugin.sol'; /// @title Algebra pool extension /// @notice Contains pool initialization and permissioned setter logic, called via delegatecall from pool -/// @dev IMPORTANT: This extension is currently designed only for logic that does not require token0/token1 or other pool immutables. -/// If additional logic that depends on token addresses needs to be moved here (e.g. flash), -/// getDeployParameters must be updated to provide those values +/// @dev The pool immutables except `factory` are zero here, see `_getDeployParameters` /// @dev Version: Algebra Integral 1.3 contract AlgebraPoolExtension is AlgebraPoolBase, ReentrancyGuard { using Plugins for uint16; using Plugins for bytes4; - /// @dev Extension is deployed by the factory, so msg.sender == factory. - /// Only factory immutable needed for this extension, it is used for permission checks - /// token0, token1, algebraPoolExtension, deployer are set to address(0) because the current setters don't need them - function _getDeployParameters() internal virtual view override returns (address, address, address, address, address, address) { + /// @dev Deployed by the factory, which is `msg.sender` here. The extension needs only `factory`, for the permission checks. + /// It is shared by all pools, so logic that needs the tokens or other pool immutables (e.g. flash) cannot be moved here as is + function _getDeployParameters() internal view virtual override returns (address, address, address, address, address, address) { return (address(0), msg.sender, address(0), address(0), address(0), address(0)); } @@ -54,21 +51,49 @@ contract AlgebraPoolExtension is AlgebraPoolBase, ReentrancyGuard { } // Stub implementations for interface methods that remain in AlgebraPool - function mint(address, address, int24, int24, uint128, bytes calldata) external pure override returns (uint256, uint256, uint128) { revert notAllowed(); } - function burn(int24, int24, uint128, bytes calldata) external pure override returns (uint256, uint256) { revert notAllowed(); } - function collect(address, int24, int24, uint128, uint128) external pure override returns (uint128, uint128) { revert notAllowed(); } - function swap(address, bool, int256, uint160, bytes calldata) external pure override returns (int256, int256) { revert notAllowed(); } - function swapWithPaymentInAdvance(address, address, bool, int256, uint160, bytes calldata) external pure override returns (int256, int256) { revert notAllowed(); } - function flash(address, uint256, uint256, bytes calldata) external pure override { revert notAllowed(); } - function sync() external pure override { revert notAllowed(); } - function skim() external pure override { revert notAllowed(); } - function claimCommunityFee() external pure override returns (uint128, uint128) { revert notAllowed(); } - function getReserves() external pure override returns (uint128, uint128) { revert notAllowed(); } - function positions(bytes32) external pure override returns (uint256, uint256, uint256, uint128, uint128) { revert notAllowed(); } - function tickTreeRoot() external pure override returns (uint32) { revert notAllowed(); } - function tickTreeSecondLayer(int16) external pure override returns (uint256) { revert notAllowed(); } - - function _addOrRemoveTicks(int24, int24, bool, bool, int24, bool) internal pure override { revert notAllowed(); } + function mint(address, address, int24, int24, uint128, bytes calldata) external pure override returns (uint256, uint256, uint128) { + revert notAllowed(); + } + function burn(int24, int24, uint128, bytes calldata) external pure override returns (uint256, uint256) { + revert notAllowed(); + } + function collect(address, int24, int24, uint128, uint128) external pure override returns (uint128, uint128) { + revert notAllowed(); + } + function swap(address, bool, int256, uint160, bytes calldata) external pure override returns (int256, int256) { + revert notAllowed(); + } + function swapWithPaymentInAdvance(address, address, bool, int256, uint160, bytes calldata) external pure override returns (int256, int256) { + revert notAllowed(); + } + function flash(address, uint256, uint256, bytes calldata) external pure override { + revert notAllowed(); + } + function sync() external pure override { + revert notAllowed(); + } + function skim() external pure override { + revert notAllowed(); + } + function claimCommunityFee() external pure override returns (uint128, uint128) { + revert notAllowed(); + } + function getReserves() external pure override returns (uint128, uint128) { + revert notAllowed(); + } + function positions(bytes32) external pure override returns (uint256, uint256, uint256, uint128, uint128) { + revert notAllowed(); + } + function tickTreeRoot() external pure override returns (uint32) { + revert notAllowed(); + } + function tickTreeSecondLayer(int16) external pure override returns (uint256) { + revert notAllowed(); + } + + function _addOrRemoveTicks(int24, int24, bool, bool, int24, bool) internal pure override { + revert notAllowed(); + } /// @dev using function to save bytecode function _checkIfAdministrator() private view { @@ -76,7 +101,7 @@ contract AlgebraPoolExtension is AlgebraPoolBase, ReentrancyGuard { } // permissioned actions use reentrancy lock to prevent call from callback (to keep the correct order of events, etc.) - + function setCommunityFee(uint16 newCommunityFee) external override onlyUnlocked { _checkIfAdministrator(); if ( diff --git a/src/core/contracts/base/SwapCalculation.sol b/src/core/contracts/base/SwapCalculation.sol index 570c4cad6..b63fbc919 100644 --- a/src/core/contracts/base/SwapCalculation.sol +++ b/src/core/contracts/base/SwapCalculation.sol @@ -113,7 +113,7 @@ abstract contract SwapCalculation is AlgebraPoolBase { cache.amountCalculated = cache.amountCalculated.add(step.input.toInt256()); // increase calculated input amount } - uint256 stepFeeAmount = step.feeAmount; // save before community/plugin fee deduction + uint256 stepFeeAmount = step.feeAmount; // save before community fee deduction if (cache.communityFee > 0) { uint256 delta = (step.feeAmount.mul(cache.communityFee)) / Constants.COMMUNITY_FEE_DENOMINATOR; @@ -147,8 +147,16 @@ abstract contract SwapCalculation is AlgebraPoolBase { (currentTick, cache.prevInitializedTick) = (step.nextTick, step.nextTick); } // the step input without the fee, as the fee may be in the output token - if (_afterCross(zeroToOne, cache.feeOnInput ? step.input - stepFeeAmount : step.input, stepFeeAmount, step.nextTick, liquidityDelta, currentLiquidity)) - fees.feeAmount = 0; // the plugin has got the fee up to this tick + if ( + _afterCross( + zeroToOne, + cache.feeOnInput ? step.input - stepFeeAmount : step.input, + stepFeeAmount, + step.nextTick, + liquidityDelta, + currentLiquidity + ) + ) fees.feeAmount = 0; // the plugin has got the fee up to this tick currentLiquidity = LiquidityMath.addDelta(currentLiquidity, liquidityDelta); } else if (currentPrice != step.stepSqrtPrice) { currentTick = TickMath.getTickAtSqrtRatio(currentPrice); // the price has changed but hasn't reached the target diff --git a/src/core/contracts/interfaces/pool/IAlgebraPoolEvents.sol b/src/core/contracts/interfaces/pool/IAlgebraPoolEvents.sol index 172d1fbc7..ae0ba9c49 100644 --- a/src/core/contracts/interfaces/pool/IAlgebraPoolEvents.sol +++ b/src/core/contracts/interfaces/pool/IAlgebraPoolEvents.sol @@ -110,15 +110,11 @@ interface IAlgebraPoolEvents { /// @param newCommunityVault New community vault event CommunityVault(address newCommunityVault); - /// @notice Emitted when community fees are distributed from the pool + /// @notice Emitted when the community vault claims the community fees /// @param communityVault The address of the community vault /// @param communityFeeAmount0 The amount of token0 sent to communityVault /// @param communityFeeAmount1 The amount of token1 sent to communityVault - event CommunityFeeTransfer( - address communityVault, - uint256 communityFeeAmount0, - uint256 communityFeeAmount1 - ); + event CommunityFeeTransfer(address communityVault, uint256 communityFeeAmount0, uint256 communityFeeAmount1); /// @notice Emitted when the plugin does skim the excess of tokens /// @param to THe receiver of tokens (plugin) From 88707efe7363403fa41997704351f78d77a87549 Mon Sep 17 00:00:00 2001 From: Lifopam Date: Thu, 15 Oct 2026 14:13:08 +0300 Subject: [PATCH 4/6] format contracts & check formatting in ci --- .github/workflows/checks.yml | 15 + package.json | 2 +- src/core/contracts/base/AlgebraPoolBase.sol | 8 +- src/core/contracts/base/ReservesManager.sol | 7 +- .../contracts/interfaces/IAlgebraFactory.sol | 1 - .../interfaces/pool/IAlgebraPoolState.sol | 5 +- .../contracts/libraries/PriceMovementMath.sol | 10 +- src/core/contracts/libraries/TickMath.sol | 6 +- src/core/contracts/test/LiquidityAmounts.sol | 24 +- src/core/contracts/test/MockDeltaPlugin.sol | 3 +- src/core/contracts/test/MockPoolPlugin.sol | 6 +- .../test/TestAlgebraReentrantCallee.sol | 17 -- .../AssertDeltasEchidnaTest.sol | 6 +- .../echidna/PriceMovementMathEchidnaTest.sol | 7 +- src/farming/contracts/FarmingCenter.sol | 6 +- .../farmings/AlgebraEternalFarming.sol | 2 +- .../interfaces/IAlgebraEternalFarming.sol | 9 +- .../contracts/test/MockFarmingPlugin.sol | 286 ++++++++++-------- .../test/MockFarmingPluginFactory.sol | 94 +++--- .../contracts/test/NftPosManagerMock.sol | 1 - .../contracts/NonfungiblePositionManager.sol | 3 +- .../contracts/interfaces/IERC721Permit.sol | 9 +- .../INonfungibleTokenPositionDescriptor.sol | 8 +- .../interfaces/IPeripheryPayments.sol | 6 +- .../contracts/interfaces/ISelfPermit.sol | 9 +- .../lens/AlgebraInterfaceMulticall3.sol | 48 ++- src/periphery/contracts/libraries/NFTSVG.sol | 6 +- .../contracts/libraries/PositionKey.sol | 6 +- .../contracts/libraries/PositionValue.sol | 6 +- .../contracts/libraries/TransferHelper.sol | 19 +- src/periphery/contracts/test/CustomPlugin.sol | 9 +- src/periphery/contracts/test/MockPlugin.sol | 19 +- .../contracts/test/MockSilentRevertPlugin.sol | 9 +- .../contracts/test/SelfPermitTest.sol | 4 +- 34 files changed, 322 insertions(+), 354 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 37b9c3188..8ebc3309f 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -31,3 +31,18 @@ jobs: check_filenames: true skip: package-lock.json,node_modules,Base64.spec.ts.snap only_warn: 1 + + Prettier: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + - uses: actions/setup-node@v7 + with: + node-version: 24 + cache: 'npm' + cache-dependency-path: package-lock.json + - run: npm run ci-install + - run: npm run lint diff --git a/package.json b/package.json index 2ddecb91a..dbd70802e 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "scripts": { "prepare": "husky", - "lint": "prettier \"src/**/contracts/**/*.sol\"", + "lint": "prettier --check \"src/**/contracts/**/*.sol\"", "solhint": "npm run solhint --workspace=src/core --if-present && npm run solhint --workspace=src/periphery --if-present && npm run solhint --workspace=src/farming --if-present", "bootstrap": "npm install && npm run compile", "compile": "cd src/core && hardhat compile && cd ../periphery && hardhat compile && cd ../farming && hardhat compile", diff --git a/src/core/contracts/base/AlgebraPoolBase.sol b/src/core/contracts/base/AlgebraPoolBase.sol index 4fa922cca..4fbffa4a3 100644 --- a/src/core/contracts/base/AlgebraPoolBase.sol +++ b/src/core/contracts/base/AlgebraPoolBase.sol @@ -169,7 +169,7 @@ abstract contract AlgebraPoolBase is IAlgebraPool, Timestamp { return IAlgebraFactory(factory).defaultConfigurationForPool(); } - /// @dev Uses the standard OZ Proxy._delegate() + /// @dev Uses the standard OZ Proxy._delegate() function _delegateToExtension() internal { address _extension = algebraPoolExtension; assembly { @@ -188,10 +188,10 @@ abstract contract AlgebraPoolBase is IAlgebraPool, Timestamp { switch result // delegatecall returns 0 on error. case 0 { - revert(0, returndatasize()) + revert(0, returndatasize()) } - default { - return(0, returndatasize()) + default { + return(0, returndatasize()) } } } diff --git a/src/core/contracts/base/ReservesManager.sol b/src/core/contracts/base/ReservesManager.sol index 99d244438..7e5560735 100644 --- a/src/core/contracts/base/ReservesManager.sol +++ b/src/core/contracts/base/ReservesManager.sol @@ -73,12 +73,7 @@ abstract contract ReservesManager is AlgebraPoolBase { /// @param deltaR1 Amount of token1 to add/subtract to/from reserve1, must not exceed uint128 /// @param communityFee0 Amount of token0 to accumulate as communityFee, must not exceed uint128 /// @param communityFee1 Amount of token1 to accumulate as communityFee, must not exceed uint128 - function _changeReserves( - int256 deltaR0, - int256 deltaR1, - uint256 communityFee0, - uint256 communityFee1 - ) internal { + function _changeReserves(int256 deltaR0, int256 deltaR1, uint256 communityFee0, uint256 communityFee1) internal { if (communityFee0 | communityFee1 != 0) { // the pending fees are a part of the reserves, so the casts are safe if the reserves fit in uint128 below (communityFeePending0, communityFeePending1) = (uint128(communityFeePending0 + communityFee0), uint128(communityFeePending1 + communityFee1)); diff --git a/src/core/contracts/interfaces/IAlgebraFactory.sol b/src/core/contracts/interfaces/IAlgebraFactory.sol index 39c6ff23e..860d9b8f7 100644 --- a/src/core/contracts/interfaces/IAlgebraFactory.sol +++ b/src/core/contracts/interfaces/IAlgebraFactory.sol @@ -202,5 +202,4 @@ interface IAlgebraFactory { /// @notice Stops process of renounceOwnership and removes timer. function stopRenounceOwnership() external; - } diff --git a/src/core/contracts/interfaces/pool/IAlgebraPoolState.sol b/src/core/contracts/interfaces/pool/IAlgebraPoolState.sol index 50b88f256..9177f77b7 100644 --- a/src/core/contracts/interfaces/pool/IAlgebraPoolState.sol +++ b/src/core/contracts/interfaces/pool/IAlgebraPoolState.sol @@ -41,10 +41,7 @@ interface IAlgebraPoolState { /// @return pluginConfig The current plugin config as bitmap. Each bit enables a hook or a feature (dynamic fee, amount deltas), see `Plugins` /// @return communityFee The community fee represented as a percent of all collected fee in thousandths, i.e. 1e-3 (so 100 is 10%) /// @return unlocked Reentrancy lock flag, true if the pool currently is unlocked, otherwise - false - function globalState() - external - view - returns (uint160 price, int24 tick, uint16 lastFee, uint16 pluginConfig, uint16 communityFee, bool unlocked); + function globalState() external view returns (uint160 price, int24 tick, uint16 lastFee, uint16 pluginConfig, uint16 communityFee, bool unlocked); /// @notice The token in which the swap fee is collected: 0 - the input token of each swap, 1 - always token0, 2 - always token1 /// @return The fee mode diff --git a/src/core/contracts/libraries/PriceMovementMath.sol b/src/core/contracts/libraries/PriceMovementMath.sol index f01b12281..c3b688e5d 100644 --- a/src/core/contracts/libraries/PriceMovementMath.sol +++ b/src/core/contracts/libraries/PriceMovementMath.sol @@ -164,7 +164,8 @@ library PriceMovementMath { resultPrice = getNewPriceAfterOutput(currentPrice, liquidity, uint256(amountAvailable), zeroToOne); // should be always true if the price is in the allowed range - if (targetPrice != resultPrice) output = (zeroToOne ? getOutputTokenDelta01 : getOutputTokenDelta10)(resultPrice, currentPrice, liquidity); + if (targetPrice != resultPrice) + output = (zeroToOne ? getOutputTokenDelta01 : getOutputTokenDelta10)(resultPrice, currentPrice, liquidity); // cap the output amount to not exceed the remaining output amount if (output > uint256(amountAvailable)) output = uint256(amountAvailable); @@ -174,7 +175,8 @@ library PriceMovementMath { feeAmount = FullMath.mulDivRoundingUp(input, fee, Constants.FEE_DENOMINATOR - fee); } else { // amountAvailable is net, so the pool releases it grossed up by the fee - uint256 grossRequired = uint256(amountAvailable) + FullMath.mulDivRoundingUp(uint256(amountAvailable), fee, Constants.FEE_DENOMINATOR - fee); + uint256 grossRequired = uint256(amountAvailable) + + FullMath.mulDivRoundingUp(uint256(amountAvailable), fee, Constants.FEE_DENOMINATOR - fee); // the sum overflows at fee >= 50%, saturate instead of wrapping if (grossRequired < uint256(amountAvailable)) grossRequired = type(uint256).max; output = (zeroToOne ? getOutputTokenDelta01 : getOutputTokenDelta10)(targetPrice, currentPrice, liquidity); @@ -185,7 +187,8 @@ library PriceMovementMath { output -= feeAmount; } else { resultPrice = getNewPriceAfterOutput(currentPrice, liquidity, grossRequired, zeroToOne); - if (targetPrice != resultPrice) output = (zeroToOne ? getOutputTokenDelta01 : getOutputTokenDelta10)(resultPrice, currentPrice, liquidity); + if (targetPrice != resultPrice) + output = (zeroToOne ? getOutputTokenDelta01 : getOutputTokenDelta10)(resultPrice, currentPrice, liquidity); // cap the released amount to the grossed up requirement if (output > grossRequired) output = grossRequired; // the fee is the remainder, a second rounded share would leave the recipient short @@ -199,5 +202,4 @@ library PriceMovementMath { } } } - } diff --git a/src/core/contracts/libraries/TickMath.sol b/src/core/contracts/libraries/TickMath.sol index b82c59e72..7f595056b 100644 --- a/src/core/contracts/libraries/TickMath.sol +++ b/src/core/contracts/libraries/TickMath.sol @@ -216,7 +216,11 @@ library TickMath { int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128); int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128); - tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= price ? tickHi : tickLow; + tick = tickLow == tickHi + ? tickLow + : getSqrtRatioAtTick(tickHi) <= price + ? tickHi + : tickLow; } } } diff --git a/src/core/contracts/test/LiquidityAmounts.sol b/src/core/contracts/test/LiquidityAmounts.sol index 44f79c863..73dc8414b 100644 --- a/src/core/contracts/test/LiquidityAmounts.sol +++ b/src/core/contracts/test/LiquidityAmounts.sol @@ -20,11 +20,7 @@ library LiquidityAmounts { /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary /// @param amount0 The amount0 being sent in /// @return liquidity The amount of returned liquidity - function getLiquidityForAmount0( - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - uint256 amount0 - ) internal pure returns (uint128 liquidity) { + function getLiquidityForAmount0(uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint256 amount0) internal pure returns (uint128 liquidity) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); uint256 intermediate = FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, Constants.Q96); return toUint128(FullMath.mulDiv(amount0, intermediate, sqrtRatioBX96 - sqrtRatioAX96)); @@ -36,11 +32,7 @@ library LiquidityAmounts { /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary /// @param amount1 The amount1 being sent in /// @return liquidity The amount of returned liquidity - function getLiquidityForAmount1( - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - uint256 amount1 - ) internal pure returns (uint128 liquidity) { + function getLiquidityForAmount1(uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint256 amount1) internal pure returns (uint128 liquidity) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); return toUint128(FullMath.mulDiv(amount1, Constants.Q96, sqrtRatioBX96 - sqrtRatioAX96)); } @@ -79,11 +71,7 @@ library LiquidityAmounts { /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary /// @param liquidity The liquidity being valued /// @return amount0 The amount of token0 - function getAmount0ForLiquidity( - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - uint128 liquidity - ) internal pure returns (uint256 amount0) { + function getAmount0ForLiquidity(uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint128 liquidity) internal pure returns (uint256 amount0) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); return FullMath.mulDiv(uint256(liquidity) << Constants.RESOLUTION, sqrtRatioBX96 - sqrtRatioAX96, sqrtRatioBX96) / sqrtRatioAX96; @@ -94,11 +82,7 @@ library LiquidityAmounts { /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary /// @param liquidity The liquidity being valued /// @return amount1 The amount of token1 - function getAmount1ForLiquidity( - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - uint128 liquidity - ) internal pure returns (uint256 amount1) { + function getAmount1ForLiquidity(uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint128 liquidity) internal pure returns (uint256 amount1) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); return FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, Constants.Q96); diff --git a/src/core/contracts/test/MockDeltaPlugin.sol b/src/core/contracts/test/MockDeltaPlugin.sol index b80820055..fe8a5a55b 100644 --- a/src/core/contracts/test/MockDeltaPlugin.sol +++ b/src/core/contracts/test/MockDeltaPlugin.sol @@ -92,7 +92,8 @@ contract MockDeltaPlugin is IAlgebraPlugin, IAlgebraDynamicFeePlugin { bytes calldata ) external override returns (bytes4, uint256 amountInIncrease, uint256 amountOutDecrease) { afterSwapCalculationCalls++; - if (reenter) IAlgebraPoolActions(msg.sender).swap(address(this), zeroToOne, 1, zeroToOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1, ''); + if (reenter) + IAlgebraPoolActions(msg.sender).swap(address(this), zeroToOne, 1, zeroToOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1, ''); (seenCalc0, seenCalc1, seenCalcAmountRequired) = (amount0, amount1, amountRequired); (int256 amountIn, int256 amountOut) = zeroToOne ? (amount0, amount1) : (amount1, amount0); amountInIncrease = _apply(inIncrease, amountIn > 0 ? uint256(amountIn) : 0); diff --git a/src/core/contracts/test/MockPoolPlugin.sol b/src/core/contracts/test/MockPoolPlugin.sol index 8b04b5661..d6f058a0f 100644 --- a/src/core/contracts/test/MockPoolPlugin.sol +++ b/src/core/contracts/test/MockPoolPlugin.sol @@ -129,8 +129,7 @@ contract MockPoolPlugin is IAlgebraPlugin, IAlgebraDynamicFeePlugin { bytes calldata data ) external override returns (bytes4) { emit BeforeModifyPosition(sender, recipient, bottomTick, topTick, desiredLiquidityDelta, data); - if (!Plugins.hasFlag(selectorsDisableConfig, Plugins.BEFORE_POSITION_MODIFY_FLAG)) - return IAlgebraPlugin.beforeModifyPosition.selector; + if (!Plugins.hasFlag(selectorsDisableConfig, Plugins.BEFORE_POSITION_MODIFY_FLAG)) return IAlgebraPlugin.beforeModifyPosition.selector; return IAlgebraPlugin.defaultPluginConfig.selector; } @@ -165,8 +164,7 @@ contract MockPoolPlugin is IAlgebraPlugin, IAlgebraDynamicFeePlugin { bytes calldata data ) external override returns (uint256, bytes4, uint24) { emit BeforeSwap(sender, recipient, zeroToOne, amountRequired, limitSqrtPrice, withPaymentInAdvance, data); - if (!Plugins.hasFlag(selectorsDisableConfig, Plugins.BEFORE_SWAP_FLAG)) - return (amountInDecrease, IAlgebraPlugin.beforeSwap.selector, dynamicFee); + if (!Plugins.hasFlag(selectorsDisableConfig, Plugins.BEFORE_SWAP_FLAG)) return (amountInDecrease, IAlgebraPlugin.beforeSwap.selector, dynamicFee); return (0, IAlgebraPlugin.defaultPluginConfig.selector, dynamicFee); } diff --git a/src/core/contracts/test/TestAlgebraReentrantCallee.sol b/src/core/contracts/test/TestAlgebraReentrantCallee.sol index 18bbd26c5..1f86605e0 100644 --- a/src/core/contracts/test/TestAlgebraReentrantCallee.sol +++ b/src/core/contracts/test/TestAlgebraReentrantCallee.sol @@ -24,42 +24,34 @@ contract TestAlgebraReentrantCallee is IAlgebraSwapCallback { try IAlgebraPool(msg.sender).swap(address(0), false, 1, 0, new bytes(0)) {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter swap supporting fee try IAlgebraPool(msg.sender).swapWithPaymentInAdvance(address(0), address(0), false, 1, 0, new bytes(0)) {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter mint try IAlgebraPool(msg.sender).mint(address(0), address(0), 0, tickSpacing, 100, new bytes(0)) {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter collect try IAlgebraPool(msg.sender).collect(address(0), 0, 0, 0, 0) {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter burn try IAlgebraPool(msg.sender).burn(0, tickSpacing, 0, new bytes(0)) {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter flash try IAlgebraPool(msg.sender).flash(address(0), 0, 0, new bytes(0)) {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter setCommunityFee try IAlgebraPool(msg.sender).setCommunityFee(10) {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter setTickSpacing try IAlgebraPool(msg.sender).setTickSpacing(20) {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter setFeeMode. Unlike the probes above, this one also fails if the call goes through: // the callee holds the administrator role here, so a missing lock would let it succeed silently try IAlgebraPool(msg.sender).setFeeMode(1) { @@ -67,49 +59,40 @@ contract TestAlgebraReentrantCallee is IAlgebraSwapCallback { } catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter setPlugin try IAlgebraPool(msg.sender).setPlugin(address(this)) {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter setPluginConfig try IAlgebraPool(msg.sender).setPluginConfig(1) {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter setFee try IAlgebraPool(msg.sender).setFee(120) {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter setCommunityVault try IAlgebraPool(msg.sender).setCommunityVault(address(this)) {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to get AMM state try IAlgebraPool(msg.sender).safelyGetStateOfAMM() {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter sync try IAlgebraPool(msg.sender).sync() {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter skim try IAlgebraPool(msg.sender).skim() {} catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - // try to reenter claimCommunityFee. The callee is the community vault here, so a missing lock would let it succeed try IAlgebraPool(msg.sender).claimCommunityFee() { revert('claimCommunityFee was not locked'); } catch (bytes memory reason) { require(bytes4(reason) == desiredSelector); } - require(IAlgebraPool(msg.sender).isUnlocked() == false); require(false, 'Unable to reenter'); diff --git a/src/core/contracts/test/echidna/PoolMockEchidna/AssertDeltasEchidnaTest.sol b/src/core/contracts/test/echidna/PoolMockEchidna/AssertDeltasEchidnaTest.sol index 683865a60..88d2a1a4d 100644 --- a/src/core/contracts/test/echidna/PoolMockEchidna/AssertDeltasEchidnaTest.sol +++ b/src/core/contracts/test/echidna/PoolMockEchidna/AssertDeltasEchidnaTest.sol @@ -34,7 +34,11 @@ contract AssertDeltasEchidnaTest is PoolMockEchidna { constructor() { deltaPlugin = new MockDeltaPlugin(); _setPlugin(address(deltaPlugin)); - _setPluginConfig(uint16(Plugins.BEFORE_SWAP_FLAG | Plugins.AFTER_SWAP_FLAG | Plugins.AFTER_SWAP_CALCULATION_FLAG | Plugins.DYNAMIC_FEE | Plugins.AMOUNT_DELTAS_FLAG)); + _setPluginConfig( + uint16( + Plugins.BEFORE_SWAP_FLAG | Plugins.AFTER_SWAP_FLAG | Plugins.AFTER_SWAP_CALCULATION_FLAG | Plugins.DYNAMIC_FEE | Plugins.AMOUNT_DELTAS_FLAG + ) + ); globalState.price = uint160(Constants.Q96); globalState.tick = 0; diff --git a/src/core/contracts/test/echidna/PriceMovementMathEchidnaTest.sol b/src/core/contracts/test/echidna/PriceMovementMathEchidnaTest.sol index 8c5610462..3f1817cbf 100644 --- a/src/core/contracts/test/echidna/PriceMovementMathEchidnaTest.sol +++ b/src/core/contracts/test/echidna/PriceMovementMathEchidnaTest.sol @@ -99,12 +99,7 @@ contract PriceMovementMathEchidnaTest { /// @notice Both fee modes have to agree whenever the fee itself is zero /// @dev Compares what the trader gives and gets, not the raw amounts: the fee on the input books the rounding /// remainder as a fee even at a zero rate, so the split differs while `paid` does not - function checkFeeModesAgreeWithoutFee( - uint160 sqrtPriceRaw, - uint160 sqrtPriceTargetRaw, - uint128 liquidity, - int256 amountRemaining - ) external pure { + function checkFeeModesAgreeWithoutFee(uint160 sqrtPriceRaw, uint160 sqrtPriceTargetRaw, uint128 liquidity, int256 amountRemaining) external pure { _requireReachablePrices(sqrtPriceRaw, sqrtPriceTargetRaw); StepResult memory onInput = _run(true, sqrtPriceRaw, sqrtPriceTargetRaw, liquidity, amountRemaining, 0); diff --git a/src/farming/contracts/FarmingCenter.sol b/src/farming/contracts/FarmingCenter.sol index 3fec094b3..2aaf40c34 100644 --- a/src/farming/contracts/FarmingCenter.sol +++ b/src/farming/contracts/FarmingCenter.sol @@ -92,11 +92,7 @@ contract FarmingCenter is IFarmingCenter, IPositionFollower, Multicall { _exitFarming(key, tokenId, tokenOwner); // nft burned or incentive deactivated, exit completely } else { // capture the position's pre-change liquidity/vesting timestamp - (, , , uint128 prevLiquidity, uint64 prevEnteredTimestamp) = IAlgebraEternalFarming(eternalFarming).exitFarming( - key, - tokenId, - tokenOwner - ); + (, , , uint128 prevLiquidity, uint64 prevEnteredTimestamp) = IAlgebraEternalFarming(eternalFarming).exitFarming(key, tokenId, tokenOwner); if ( IAlgebraEternalFarming(eternalFarming).isIncentiveDeactivated(IncentiveId.compute(key)) || diff --git a/src/farming/contracts/farmings/AlgebraEternalFarming.sol b/src/farming/contracts/farmings/AlgebraEternalFarming.sol index 760e6088e..c2a872449 100644 --- a/src/farming/contracts/farmings/AlgebraEternalFarming.sol +++ b/src/farming/contracts/farmings/AlgebraEternalFarming.sol @@ -84,7 +84,7 @@ contract AlgebraEternalFarming is IAlgebraEternalFarming { /// @inheritdoc IAlgebraEternalFarming uint256 public numOfIncentives; - + /// @inheritdoc IAlgebraEternalFarming uint64 public override defaultFarmingBuffer; diff --git a/src/farming/contracts/interfaces/IAlgebraEternalFarming.sol b/src/farming/contracts/interfaces/IAlgebraEternalFarming.sol index 4ad7b848b..b2d643f39 100644 --- a/src/farming/contracts/interfaces/IAlgebraEternalFarming.sol +++ b/src/farming/contracts/interfaces/IAlgebraEternalFarming.sol @@ -210,14 +210,7 @@ interface IAlgebraEternalFarming { ) external view - returns ( - uint128 liquidity, - int24 tickLower, - int24 tickUpper, - uint64 enteredTimestamp, - uint256 innerRewardGrowth0, - uint256 innerRewardGrowth1 - ); + returns (uint128 liquidity, int24 tickLower, int24 tickUpper, uint64 enteredTimestamp, uint256 innerRewardGrowth0, uint256 innerRewardGrowth1); /// @notice Returns connected to pool incentive key function incentiveKeys( diff --git a/src/farming/contracts/test/MockFarmingPlugin.sol b/src/farming/contracts/test/MockFarmingPlugin.sol index 7ca774def..9a7fe6e13 100644 --- a/src/farming/contracts/test/MockFarmingPlugin.sol +++ b/src/farming/contracts/test/MockFarmingPlugin.sol @@ -8,139 +8,167 @@ import '@cryptoalgebra/integral-core/contracts/libraries/Plugins.sol'; /// @notice Minimal mock of a farming plugin for tests contract MockFarmingPlugin is IAlgebraPlugin { - using Plugins for uint16; - - address public pool; - address public pluginFactory; - - address public incentive; - address private _lastIncentiveOwner; - - modifier onlyPool() { - require(msg.sender == pool, 'Only pool'); - _; - } - - constructor(address _pool, address _pluginFactory) { - pool = _pool; - pluginFactory = _pluginFactory; - } - - /// @dev a function, not a constant: slither fails to fold a uint16 constant built from the flags - function defaultPluginConfig() public pure override returns (uint16) { - return uint16(Plugins.AFTER_SWAP_FLAG); - } - - function beforeInitialize(address, uint160) external override onlyPool returns (bytes4) { - _updatePluginConfigInPool(); - return IAlgebraPlugin.beforeInitialize.selector; - } - - function afterInitialize(address, uint160, int24) external view override onlyPool returns (bytes4) { - return IAlgebraPlugin.afterInitialize.selector; - } - - function beforeModifyPosition(address, address, int24, int24, int128, bytes calldata) - external view override onlyPool returns (bytes4) { - return IAlgebraPlugin.beforeModifyPosition.selector; - } - - function afterModifyPosition(address, address, int24, int24, int128, uint256, uint256, bytes calldata) - external view override onlyPool returns (bytes4) { - return IAlgebraPlugin.afterModifyPosition.selector; - } - - function beforeSwap(address, address, bool, int256, uint160, bool, bytes calldata) - external view override onlyPool returns (uint256, bytes4, uint24) { - return (0, IAlgebraPlugin.beforeSwap.selector, 0); - } - - function afterSwap(address, address, bool zeroToOne, int256, uint160, int256, int256, uint256, bytes calldata) - external override onlyPool returns (bytes4) { - _updateVirtualPoolTick(zeroToOne); - return IAlgebraPlugin.afterSwap.selector; - } - - function beforeFlash(address, address, uint256, uint256, bytes calldata) - external view override onlyPool returns (bytes4) { - return IAlgebraPlugin.beforeFlash.selector; - } - - function afterFlash(address, address, uint256, uint256, uint256, uint256, bytes calldata) - external view override onlyPool returns (bytes4) { - return IAlgebraPlugin.afterFlash.selector; - } - - function afterSwapCalculation(address, address, bool, int256, uint160, int256, int256, bytes memory) - external view override onlyPool returns (bytes4, uint256, uint256) { - return (IAlgebraPlugin.afterSwapCalculation.selector, 0, 0); - } - - function afterCross(bool, uint256, uint256, int24, int128, uint128) - external view override onlyPool returns (bytes4) { - return IAlgebraPlugin.afterCross.selector; - } - - function setIncentive(address newIncentive) external { - bool toConnect = newIncentive != address(0); - bool accessAllowed; - - if (toConnect) { - accessAllowed = msg.sender == IMockFarmingPluginFactory(pluginFactory).farmingAddress(); - } else { - if (_lastIncentiveOwner != address(0)) accessAllowed = msg.sender == _lastIncentiveOwner; - if (!accessAllowed) accessAllowed = msg.sender == IMockFarmingPluginFactory(pluginFactory).farmingAddress(); - } - require(accessAllowed, 'Not allowed to set incentive'); - - require(IAlgebraPool(pool).plugin() == address(this), 'Plugin not attached'); - require(incentive != newIncentive, 'Already active'); - if (toConnect) require(incentive == address(0), 'Has active incentive'); - - incentive = newIncentive; - - if (toConnect) { - _lastIncentiveOwner = msg.sender; - } else { - _lastIncentiveOwner = address(0); - } - - _updatePluginConfigInPool(); - } - - function isIncentiveConnected(address targetIncentive) external view returns (bool) { - if (incentive != targetIncentive) return false; - if (IAlgebraPool(pool).plugin() != address(this)) return false; - (, , , uint16 pluginConfig, , ) = IAlgebraPoolState(pool).globalState(); - if (!pluginConfig.hasFlag(Plugins.AFTER_SWAP_FLAG)) return false; - return true; - } - - function getPool() external view returns (address) { - return pool; - } - - function _updatePluginConfigInPool() internal { - (, , , uint16 currentPluginConfig, , ) = IAlgebraPoolState(pool).globalState(); - uint16 newPluginConfig = defaultPluginConfig(); - if (currentPluginConfig != newPluginConfig) { - IAlgebraPool(pool).setPluginConfig(newPluginConfig); - } - } - - function _updateVirtualPoolTick(bool zeroToOne) internal { - address _incentive = incentive; - if (_incentive != address(0)) { - (, int24 tick, , , , ) = IAlgebraPoolState(pool).globalState(); - IAlgebraVirtualPoolMock(_incentive).crossTo(tick, zeroToOne); - } - } + using Plugins for uint16; + + address public pool; + address public pluginFactory; + + address public incentive; + address private _lastIncentiveOwner; + + modifier onlyPool() { + require(msg.sender == pool, 'Only pool'); + _; + } + + constructor(address _pool, address _pluginFactory) { + pool = _pool; + pluginFactory = _pluginFactory; + } + + /// @dev a function, not a constant: slither fails to fold a uint16 constant built from the flags + function defaultPluginConfig() public pure override returns (uint16) { + return uint16(Plugins.AFTER_SWAP_FLAG); + } + + function beforeInitialize(address, uint160) external override onlyPool returns (bytes4) { + _updatePluginConfigInPool(); + return IAlgebraPlugin.beforeInitialize.selector; + } + + function afterInitialize(address, uint160, int24) external view override onlyPool returns (bytes4) { + return IAlgebraPlugin.afterInitialize.selector; + } + + function beforeModifyPosition(address, address, int24, int24, int128, bytes calldata) external view override onlyPool returns (bytes4) { + return IAlgebraPlugin.beforeModifyPosition.selector; + } + + function afterModifyPosition( + address, + address, + int24, + int24, + int128, + uint256, + uint256, + bytes calldata + ) external view override onlyPool returns (bytes4) { + return IAlgebraPlugin.afterModifyPosition.selector; + } + + function beforeSwap( + address, + address, + bool, + int256, + uint160, + bool, + bytes calldata + ) external view override onlyPool returns (uint256, bytes4, uint24) { + return (0, IAlgebraPlugin.beforeSwap.selector, 0); + } + + function afterSwap( + address, + address, + bool zeroToOne, + int256, + uint160, + int256, + int256, + uint256, + bytes calldata + ) external override onlyPool returns (bytes4) { + _updateVirtualPoolTick(zeroToOne); + return IAlgebraPlugin.afterSwap.selector; + } + + function beforeFlash(address, address, uint256, uint256, bytes calldata) external view override onlyPool returns (bytes4) { + return IAlgebraPlugin.beforeFlash.selector; + } + + function afterFlash(address, address, uint256, uint256, uint256, uint256, bytes calldata) external view override onlyPool returns (bytes4) { + return IAlgebraPlugin.afterFlash.selector; + } + + function afterSwapCalculation( + address, + address, + bool, + int256, + uint160, + int256, + int256, + bytes memory + ) external view override onlyPool returns (bytes4, uint256, uint256) { + return (IAlgebraPlugin.afterSwapCalculation.selector, 0, 0); + } + + function afterCross(bool, uint256, uint256, int24, int128, uint128) external view override onlyPool returns (bytes4) { + return IAlgebraPlugin.afterCross.selector; + } + + function setIncentive(address newIncentive) external { + bool toConnect = newIncentive != address(0); + bool accessAllowed; + + if (toConnect) { + accessAllowed = msg.sender == IMockFarmingPluginFactory(pluginFactory).farmingAddress(); + } else { + if (_lastIncentiveOwner != address(0)) accessAllowed = msg.sender == _lastIncentiveOwner; + if (!accessAllowed) accessAllowed = msg.sender == IMockFarmingPluginFactory(pluginFactory).farmingAddress(); + } + require(accessAllowed, 'Not allowed to set incentive'); + + require(IAlgebraPool(pool).plugin() == address(this), 'Plugin not attached'); + require(incentive != newIncentive, 'Already active'); + if (toConnect) require(incentive == address(0), 'Has active incentive'); + + incentive = newIncentive; + + if (toConnect) { + _lastIncentiveOwner = msg.sender; + } else { + _lastIncentiveOwner = address(0); + } + + _updatePluginConfigInPool(); + } + + function isIncentiveConnected(address targetIncentive) external view returns (bool) { + if (incentive != targetIncentive) return false; + if (IAlgebraPool(pool).plugin() != address(this)) return false; + (, , , uint16 pluginConfig, , ) = IAlgebraPoolState(pool).globalState(); + if (!pluginConfig.hasFlag(Plugins.AFTER_SWAP_FLAG)) return false; + return true; + } + + function getPool() external view returns (address) { + return pool; + } + + function _updatePluginConfigInPool() internal { + (, , , uint16 currentPluginConfig, , ) = IAlgebraPoolState(pool).globalState(); + uint16 newPluginConfig = defaultPluginConfig(); + if (currentPluginConfig != newPluginConfig) { + IAlgebraPool(pool).setPluginConfig(newPluginConfig); + } + } + + function _updateVirtualPoolTick(bool zeroToOne) internal { + address _incentive = incentive; + if (_incentive != address(0)) { + (, int24 tick, , , , ) = IAlgebraPoolState(pool).globalState(); + IAlgebraVirtualPoolMock(_incentive).crossTo(tick, zeroToOne); + } + } } interface IMockFarmingPluginFactory { - function farmingAddress() external view returns (address); + function farmingAddress() external view returns (address); } interface IAlgebraVirtualPoolMock { - function crossTo(int24 targetTick, bool zeroToOne) external returns (bool); + function crossTo(int24 targetTick, bool zeroToOne) external returns (bool); } diff --git a/src/farming/contracts/test/MockFarmingPluginFactory.sol b/src/farming/contracts/test/MockFarmingPluginFactory.sol index 1d4e564ce..b4007cbfa 100644 --- a/src/farming/contracts/test/MockFarmingPluginFactory.sol +++ b/src/farming/contracts/test/MockFarmingPluginFactory.sol @@ -7,56 +7,46 @@ import './MockFarmingPlugin.sol'; /// @notice Minimal mock of a plugin factory for farming tests contract MockFarmingPluginFactory is IAlgebraPluginFactory { - address public algebraFactory; - address public farmingAddress; - - mapping(address => address) public pluginByPool; - - modifier onlyAdministrator() { - require( - IAlgebraFactory(algebraFactory).hasRoleOrOwner(keccak256('ALGEBRA_BASE_PLUGIN_FACTORY_ADMINISTRATOR'), msg.sender), - 'Only administrator' - ); - _; - } - - constructor(address _algebraFactory) { - algebraFactory = _algebraFactory; - } - - function beforeCreatePoolHook( - address pool, - address, - address, - address, - address, - bytes calldata - ) external override returns (address) { - require(msg.sender == algebraFactory, 'Only factory'); - return _createPlugin(pool); - } - - function afterCreatePoolHook(address, address, address) external view override { - require(msg.sender == algebraFactory, 'Only factory'); - } - - function createPluginForExistingPool(address token0, address token1) external returns (address) { - IAlgebraFactory factory = IAlgebraFactory(algebraFactory); - require(factory.hasRoleOrOwner(factory.POOLS_ADMINISTRATOR_ROLE(), msg.sender), 'Not admin'); - address pool = factory.poolByPair(token0, token1); - require(pool != address(0), 'Pool not exist'); - return _createPlugin(pool); - } - - function setFarmingAddress(address newFarmingAddress) external onlyAdministrator { - require(farmingAddress != newFarmingAddress, 'Already set'); - farmingAddress = newFarmingAddress; - } - - function _createPlugin(address pool) internal returns (address) { - require(pluginByPool[pool] == address(0), 'Already created'); - MockFarmingPlugin plugin = new MockFarmingPlugin(pool, address(this)); - pluginByPool[pool] = address(plugin); - return address(plugin); - } + address public algebraFactory; + address public farmingAddress; + + mapping(address => address) public pluginByPool; + + modifier onlyAdministrator() { + require(IAlgebraFactory(algebraFactory).hasRoleOrOwner(keccak256('ALGEBRA_BASE_PLUGIN_FACTORY_ADMINISTRATOR'), msg.sender), 'Only administrator'); + _; + } + + constructor(address _algebraFactory) { + algebraFactory = _algebraFactory; + } + + function beforeCreatePoolHook(address pool, address, address, address, address, bytes calldata) external override returns (address) { + require(msg.sender == algebraFactory, 'Only factory'); + return _createPlugin(pool); + } + + function afterCreatePoolHook(address, address, address) external view override { + require(msg.sender == algebraFactory, 'Only factory'); + } + + function createPluginForExistingPool(address token0, address token1) external returns (address) { + IAlgebraFactory factory = IAlgebraFactory(algebraFactory); + require(factory.hasRoleOrOwner(factory.POOLS_ADMINISTRATOR_ROLE(), msg.sender), 'Not admin'); + address pool = factory.poolByPair(token0, token1); + require(pool != address(0), 'Pool not exist'); + return _createPlugin(pool); + } + + function setFarmingAddress(address newFarmingAddress) external onlyAdministrator { + require(farmingAddress != newFarmingAddress, 'Already set'); + farmingAddress = newFarmingAddress; + } + + function _createPlugin(address pool) internal returns (address) { + require(pluginByPool[pool] == address(0), 'Already created'); + MockFarmingPlugin plugin = new MockFarmingPlugin(pool, address(this)); + pluginByPool[pool] = address(plugin); + return address(plugin); + } } diff --git a/src/farming/contracts/test/NftPosManagerMock.sol b/src/farming/contracts/test/NftPosManagerMock.sol index 17a5be09f..89225b994 100644 --- a/src/farming/contracts/test/NftPosManagerMock.sol +++ b/src/farming/contracts/test/NftPosManagerMock.sol @@ -4,7 +4,6 @@ pragma solidity =0.8.26; import '../interfaces/IAlgebraEternalVirtualPool.sol'; import '@cryptoalgebra/integral-periphery/contracts/interfaces/IPositionFollower.sol'; - /// @dev Test contract for virtual pool onlyPool methods contract NftPosManagerMock { struct Position { diff --git a/src/periphery/contracts/NonfungiblePositionManager.sol b/src/periphery/contracts/NonfungiblePositionManager.sol index b69c3fd71..7f21a53d9 100644 --- a/src/periphery/contracts/NonfungiblePositionManager.sol +++ b/src/periphery/contracts/NonfungiblePositionManager.sol @@ -516,7 +516,8 @@ contract NonfungiblePositionManager is // the same checks as in `ERC721._approve`, only the storage of the operator differs if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); - if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) revert ERC721InvalidApprover(auth); + if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) + revert ERC721InvalidApprover(auth); if (emitEvent) emit Approval(owner, to, tokenId); } _positions[tokenId].operator = to; diff --git a/src/periphery/contracts/interfaces/IERC721Permit.sol b/src/periphery/contracts/interfaces/IERC721Permit.sol index 1c345c847..6d4d2957c 100644 --- a/src/periphery/contracts/interfaces/IERC721Permit.sol +++ b/src/periphery/contracts/interfaces/IERC721Permit.sol @@ -21,12 +21,5 @@ interface IERC721Permit is IERC721 { /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` - function permit( - address spender, - uint256 tokenId, - uint256 deadline, - uint8 v, - bytes32 r, - bytes32 s - ) external payable; + function permit(address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external payable; } diff --git a/src/periphery/contracts/interfaces/INonfungibleTokenPositionDescriptor.sol b/src/periphery/contracts/interfaces/INonfungibleTokenPositionDescriptor.sol index 0a91ca1ad..4e434eeb2 100644 --- a/src/periphery/contracts/interfaces/INonfungibleTokenPositionDescriptor.sol +++ b/src/periphery/contracts/interfaces/INonfungibleTokenPositionDescriptor.sol @@ -12,8 +12,8 @@ interface INonfungibleTokenPositionDescriptor { /// @param positionManager The position manager for which to describe the token /// @param tokenId The ID of the token for which to produce a description, which may not be valid /// @return The URI of the ERC721-compliant metadata - function tokenURI(INonfungiblePositionManager positionManager, uint256 tokenId) - external - view - returns (string memory); + function tokenURI( + INonfungiblePositionManager positionManager, + uint256 tokenId + ) external view returns (string memory); } diff --git a/src/periphery/contracts/interfaces/IPeripheryPayments.sol b/src/periphery/contracts/interfaces/IPeripheryPayments.sol index fa5daa2c2..f55cb3f44 100644 --- a/src/periphery/contracts/interfaces/IPeripheryPayments.sol +++ b/src/periphery/contracts/interfaces/IPeripheryPayments.sol @@ -22,9 +22,5 @@ interface IPeripheryPayments { /// @param token The contract address of the token which will be transferred to `recipient` /// @param amountMinimum The minimum amount of token required for a transfer /// @param recipient The destination address of the token - function sweepToken( - address token, - uint256 amountMinimum, - address recipient - ) external payable; + function sweepToken(address token, uint256 amountMinimum, address recipient) external payable; } diff --git a/src/periphery/contracts/interfaces/ISelfPermit.sol b/src/periphery/contracts/interfaces/ISelfPermit.sol index 0ab8a25af..3ac0036da 100644 --- a/src/periphery/contracts/interfaces/ISelfPermit.sol +++ b/src/periphery/contracts/interfaces/ISelfPermit.sol @@ -12,14 +12,7 @@ interface ISelfPermit { /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` - function selfPermit( - address token, - uint256 value, - uint256 deadline, - uint8 v, - bytes32 r, - bytes32 s - ) external payable; + function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external payable; /// @notice Permits this contract to spend a given token from `msg.sender` /// @dev The `owner` is always msg.sender and the `spender` is always address(this). diff --git a/src/periphery/contracts/lens/AlgebraInterfaceMulticall3.sol b/src/periphery/contracts/lens/AlgebraInterfaceMulticall3.sol index bad2e23dd..3a1ee0d26 100644 --- a/src/periphery/contracts/lens/AlgebraInterfaceMulticall3.sol +++ b/src/periphery/contracts/lens/AlgebraInterfaceMulticall3.sol @@ -36,12 +36,14 @@ contract AlgebraInterfaceMulticall3 { uint256 length = calls.length; returnData = new bytes[](length); Call calldata call; - for (uint256 i = 0; i < length;) { + for (uint256 i = 0; i < length; ) { bool success; call = calls[i]; (success, returnData[i]) = call.target.call(call.callData); - require(success, "Multicall3: call failed"); - unchecked { ++i; } + require(success, 'Multicall3: call failed'); + unchecked { + ++i; + } } } @@ -50,16 +52,21 @@ contract AlgebraInterfaceMulticall3 { /// @param requireSuccess If true, require all calls to succeed /// @param calls An array of Call structs /// @return returnData An array of Result structs - function tryAggregate(bool requireSuccess, Call[] calldata calls) public payable returns (Result[] memory returnData) { + function tryAggregate( + bool requireSuccess, + Call[] calldata calls + ) public payable returns (Result[] memory returnData) { uint256 length = calls.length; returnData = new Result[](length); Call calldata call; - for (uint256 i = 0; i < length;) { + for (uint256 i = 0; i < length; ) { Result memory result = returnData[i]; call = calls[i]; (result.success, result.returnData) = call.target.call(call.callData); - if (requireSuccess) require(result.success, "Multicall3: call failed"); - unchecked { ++i; } + if (requireSuccess) require(result.success, 'Multicall3: call failed'); + unchecked { + ++i; + } } } @@ -69,7 +76,10 @@ contract AlgebraInterfaceMulticall3 { /// @return blockNumber The block number where the calls were executed /// @return blockHash The hash of the block where the calls were executed /// @return returnData An array of Result structs - function tryBlockAndAggregate(bool requireSuccess, Call[] calldata calls) public payable returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData) { + function tryBlockAndAggregate( + bool requireSuccess, + Call[] calldata calls + ) public payable returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData) { blockNumber = block.number; blockHash = blockhash(block.number); returnData = tryAggregate(requireSuccess, calls); @@ -81,7 +91,9 @@ contract AlgebraInterfaceMulticall3 { /// @return blockNumber The block number where the calls were executed /// @return blockHash The hash of the block where the calls were executed /// @return returnData An array of Result structs - function blockAndAggregate(Call[] calldata calls) public payable returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData) { + function blockAndAggregate( + Call[] calldata calls + ) public payable returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData) { (blockNumber, blockHash, returnData) = tryBlockAndAggregate(true, calls); } @@ -92,7 +104,7 @@ contract AlgebraInterfaceMulticall3 { uint256 length = calls.length; returnData = new Result[](length); Call3 calldata calli; - for (uint256 i = 0; i < length;) { + for (uint256 i = 0; i < length; ) { Result memory result = returnData[i]; calli = calls[i]; (result.success, result.returnData) = calli.target.call(calli.callData); @@ -111,7 +123,9 @@ contract AlgebraInterfaceMulticall3 { revert(0x00, 0x64) } } - unchecked { ++i; } + unchecked { + ++i; + } } } @@ -124,13 +138,15 @@ contract AlgebraInterfaceMulticall3 { uint256 length = calls.length; returnData = new Result[](length); Call3Value calldata calli; - for (uint256 i = 0; i < length;) { + for (uint256 i = 0; i < length; ) { Result memory result = returnData[i]; calli = calls[i]; uint256 val = calli.value; // Humanity will be a Type V Kardashev Civilization before this overflows - andreas // ~ 10^25 Wei in existence << ~ 10^76 size uint fits in a uint256 - unchecked { valAccumulator += val; } + unchecked { + valAccumulator += val; + } (result.success, result.returnData) = calli.target.call{value: val}(calli.callData); assembly { // Revert if the call fails and failure is not allowed @@ -147,10 +163,12 @@ contract AlgebraInterfaceMulticall3 { revert(0x00, 0x84) } } - unchecked { ++i; } + unchecked { + ++i; + } } // Finally, make sure the msg.value = SUM(call[0...i].value) - require(msg.value == valAccumulator, "Multicall3: value mismatch"); + require(msg.value == valAccumulator, 'Multicall3: value mismatch'); } /// @notice Returns the block hash for the given block number diff --git a/src/periphery/contracts/libraries/NFTSVG.sol b/src/periphery/contracts/libraries/NFTSVG.sol index 2c9935424..70101cd36 100644 --- a/src/periphery/contracts/libraries/NFTSVG.sol +++ b/src/periphery/contracts/libraries/NFTSVG.sol @@ -220,7 +220,11 @@ library NFTSVG { int24 tickSpacing, int8 overRange ) private pure returns (string memory svg) { - string memory fade = overRange == 1 ? '#fade-up' : overRange == -1 ? '#fade-down' : '#none'; + string memory fade = overRange == 1 + ? '#fade-up' + : overRange == -1 + ? '#fade-down' + : '#none'; string memory curve = getCurve(tickLower, tickUpper, tickSpacing); svg = string( abi.encodePacked( diff --git a/src/periphery/contracts/libraries/PositionKey.sol b/src/periphery/contracts/libraries/PositionKey.sol index dc8e96352..6fdc8a949 100644 --- a/src/periphery/contracts/libraries/PositionKey.sol +++ b/src/periphery/contracts/libraries/PositionKey.sol @@ -3,11 +3,7 @@ pragma solidity >=0.5.0; library PositionKey { /// @dev Returns the key of the position in the core library - function compute( - address owner, - int24 bottomTick, - int24 topTick - ) internal pure returns (bytes32 key) { + function compute(address owner, int24 bottomTick, int24 topTick) internal pure returns (bytes32 key) { assembly { key := or(shl(24, or(shl(24, owner), and(bottomTick, 0xFFFFFF))), and(topTick, 0xFFFFFF)) } diff --git a/src/periphery/contracts/libraries/PositionValue.sol b/src/periphery/contracts/libraries/PositionValue.sol index 327272919..cfd678178 100644 --- a/src/periphery/contracts/libraries/PositionValue.sol +++ b/src/periphery/contracts/libraries/PositionValue.sol @@ -117,16 +117,14 @@ library PositionValue { poolFeeGrowthInside0LastX128 - position.feeGrowthInside0LastX128, position.liquidity, Constants.Q128 - ) + - position.tokensOwed0; + ) + position.tokensOwed0; amount1 = FullMath.mulDiv( poolFeeGrowthInside1LastX128 - position.feeGrowthInside1LastX128, position.liquidity, Constants.Q128 - ) + - position.tokensOwed1; + ) + position.tokensOwed1; } } diff --git a/src/periphery/contracts/libraries/TransferHelper.sol b/src/periphery/contracts/libraries/TransferHelper.sol index e2f71165a..64c5dc771 100644 --- a/src/periphery/contracts/libraries/TransferHelper.sol +++ b/src/periphery/contracts/libraries/TransferHelper.sol @@ -12,12 +12,7 @@ library TransferHelper { /// @param from The originating address from which the tokens will be transferred /// @param to The destination address of the transfer /// @param value The amount to be transferred - function safeTransferFrom( - address token, - address from, - address to, - uint256 value - ) internal { + function safeTransferFrom(address token, address from, address to, uint256 value) internal { (bool success, bytes memory data) = token.call( abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value) ); @@ -29,11 +24,7 @@ library TransferHelper { /// @param token The contract address of the token which will be transferred /// @param to The recipient of the transfer /// @param value The value of the transfer - function safeTransfer( - address token, - address to, - uint256 value - ) internal { + function safeTransfer(address token, address to, uint256 value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST'); } @@ -43,11 +34,7 @@ library TransferHelper { /// @param token The contract address of the token to be approved /// @param to The target of the approval /// @param value The amount of the given token the target will be allowed to spend - function safeApprove( - address token, - address to, - uint256 value - ) internal { + function safeApprove(address token, address to, uint256 value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA'); } diff --git a/src/periphery/contracts/test/CustomPlugin.sol b/src/periphery/contracts/test/CustomPlugin.sol index d8a352de2..1ee28c576 100644 --- a/src/periphery/contracts/test/CustomPlugin.sol +++ b/src/periphery/contracts/test/CustomPlugin.sol @@ -128,14 +128,7 @@ contract CustomPlugin is Timestamp, IAlgebraPlugin { } /// @dev unused - function afterCross( - bool, - uint256, - uint256, - int24, - int128, - uint128 - ) external override returns (bytes4) { + function afterCross(bool, uint256, uint256, int24, int128, uint128) external override returns (bytes4) { _updatePluginConfigInPool(); // should not be called, reset config return IAlgebraPlugin.afterCross.selector; } diff --git a/src/periphery/contracts/test/MockPlugin.sol b/src/periphery/contracts/test/MockPlugin.sol index f20d0f77c..3d152378d 100644 --- a/src/periphery/contracts/test/MockPlugin.sol +++ b/src/periphery/contracts/test/MockPlugin.sol @@ -40,7 +40,15 @@ contract MockPlugin is IAlgebraPlugin { return IAlgebraPlugin.afterModifyPosition.selector; } - function beforeSwap(address, address, bool, int256, uint160, bool, bytes calldata) external pure returns (uint256, bytes4, uint24) { + function beforeSwap( + address, + address, + bool, + int256, + uint160, + bool, + bytes calldata + ) external pure returns (uint256, bytes4, uint24) { return (0, IAlgebraPlugin.beforeSwap.selector, 0); } @@ -87,14 +95,7 @@ contract MockPlugin is IAlgebraPlugin { return (IAlgebraPlugin.afterSwapCalculation.selector, 0, 0); } - function afterCross( - bool, - uint256, - uint256, - int24, - int128, - uint128 - ) external pure returns (bytes4) { + function afterCross(bool, uint256, uint256, int24, int128, uint128) external pure returns (bytes4) { return IAlgebraPlugin.afterCross.selector; } } diff --git a/src/periphery/contracts/test/MockSilentRevertPlugin.sol b/src/periphery/contracts/test/MockSilentRevertPlugin.sol index 1014675ac..25b8bbbc9 100644 --- a/src/periphery/contracts/test/MockSilentRevertPlugin.sol +++ b/src/periphery/contracts/test/MockSilentRevertPlugin.sol @@ -17,7 +17,14 @@ contract MockSilentRevertPlugin is IAlgebraPlugin { return IAlgebraPlugin.afterInitialize.selector; } - function beforeModifyPosition(address, address, int24, int24, int128, bytes calldata) external pure returns (bytes4) { + function beforeModifyPosition( + address, + address, + int24, + int24, + int128, + bytes calldata + ) external pure returns (bytes4) { return IAlgebraPlugin.beforeModifyPosition.selector; } diff --git a/src/periphery/contracts/test/SelfPermitTest.sol b/src/periphery/contracts/test/SelfPermitTest.sol index 77056c2ce..bf58b4594 100644 --- a/src/periphery/contracts/test/SelfPermitTest.sol +++ b/src/periphery/contracts/test/SelfPermitTest.sol @@ -4,6 +4,4 @@ pragma solidity =0.8.26; import '../base/SelfPermit.sol'; /// @dev Same as SelfPermit but not abstract -contract SelfPermitTest is SelfPermit { - -} +contract SelfPermitTest is SelfPermit {} From 4d0c6ca27853d88066c44581bca54ab75a19467e Mon Sep 17 00:00:00 2001 From: Lifopam Date: Thu, 15 Oct 2026 14:14:55 +0300 Subject: [PATCH 5/6] remove stray deploy in nft descriptor test --- src/periphery/test/NFTDescriptor.spec.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/periphery/test/NFTDescriptor.spec.ts b/src/periphery/test/NFTDescriptor.spec.ts index 920dc37f3..716ed2800 100644 --- a/src/periphery/test/NFTDescriptor.spec.ts +++ b/src/periphery/test/NFTDescriptor.spec.ts @@ -36,7 +36,6 @@ describe('NFTDescriptor', () => { }, }); const nftDescriptor = (await NFTDescriptorFactory.deploy()) as any as NFTDescriptorTest; - tokenFactory.deploy(MaxUint256 / 2n, 'Test ERC20', 'TEST1'); const tokens: [ TestERC20MetadataWithAddress, TestERC20MetadataWithAddress, From 4ea787c738d2e66247c5099e578ed4080ae830ac Mon Sep 17 00:00:00 2001 From: Lifopam Date: Thu, 15 Oct 2026 14:17:00 +0300 Subject: [PATCH 6/6] regenerate docs, don't collapse newlines --- docs/Contracts/Core/AlgebraPool.md | 7 +++---- docs/Contracts/Core/AlgebraPoolExtension.md | 11 ++++------- .../Core/interfaces/plugin/IAlgebraPlugin.md | 2 +- .../Core/interfaces/pool/IAlgebraPoolEvents.md | 2 +- .../pool/IAlgebraPoolPermissionedActions.md | 7 +++---- docs/Contracts/Periphery/interfaces/IQuoterV2.md | 8 ++++---- docs/Contracts/Periphery/lens/QuoterV2.md | 8 ++++---- src/core/hardhat.config.ts | 3 ++- src/farming/hardhat.config.ts | 3 ++- src/periphery/hardhat.config.ts | 3 ++- 10 files changed, 26 insertions(+), 28 deletions(-) diff --git a/docs/Contracts/Core/AlgebraPool.md b/docs/Contracts/Core/AlgebraPool.md index 58ecaea3d..e40ebb997 100644 --- a/docs/Contracts/Core/AlgebraPool.md +++ b/docs/Contracts/Core/AlgebraPool.md @@ -299,8 +299,8 @@ function setCommunityVault(address) external Set new community fee vault address. Only factory owner or POOLS_ADMINISTRATOR_ROLE role -*Developer note: Community fee vault receives collected community fees. -**accumulated but not yet sent to the vault community fees once will be sent to the `newCommunityVault` address*** +*Developer note: The vault claims community fees with `claimCommunityFee`, unclaimed ones only by the `newCommunityVault`. +The zero address also sets the community fee to zero* | Name | Type | Description | | ---- | ---- | ----------- | @@ -313,8 +313,7 @@ function setFee(uint16) external ``` **Selector**: `0x8e005553` -Set new pool fee. Can be called by owner if dynamic fee is disabled. -Called by the plugin if dynamic fee is enabled +Set new pool fee if dynamic fee is disabled. Only factory owner or POOLS_ADMINISTRATOR_ROLE role | Name | Type | Description | | ---- | ---- | ----------- | diff --git a/docs/Contracts/Core/AlgebraPoolExtension.md b/docs/Contracts/Core/AlgebraPoolExtension.md index 3a2fd6eb3..c85b66f09 100644 --- a/docs/Contracts/Core/AlgebraPoolExtension.md +++ b/docs/Contracts/Core/AlgebraPoolExtension.md @@ -7,9 +7,7 @@ Algebra pool extension Contains pool initialization and permissioned setter logic, called via delegatecall from pool -*Developer note: IMPORTANT: This extension is currently designed only for logic that does not require token0/token1 or other pool immutables. -If additional logic that depends on token addresses needs to be moved here (e.g. flash), -getDeployParameters must be updated to provide those values +*Developer note: The pool immutables except `factory` are zero here, see `_getDeployParameters` Version: Algebra Integral 1.3* **Inherits:** [AlgebraPoolBase](base/AlgebraPoolBase.md) ReentrancyGuard @@ -367,8 +365,8 @@ function setCommunityVault(address newCommunityVault) external Set new community fee vault address. Only factory owner or POOLS_ADMINISTRATOR_ROLE role -*Developer note: Community fee vault receives collected community fees. -**accumulated but not yet sent to the vault community fees once will be sent to the `newCommunityVault` address*** +*Developer note: The vault claims community fees with `claimCommunityFee`, unclaimed ones only by the `newCommunityVault`. +The zero address also sets the community fee to zero* | Name | Type | Description | | ---- | ---- | ----------- | @@ -381,8 +379,7 @@ function setFee(uint16 newFee) external ``` **Selector**: `0x8e005553` -Set new pool fee. Can be called by owner if dynamic fee is disabled. -Called by the plugin if dynamic fee is enabled +Set new pool fee if dynamic fee is disabled. Only factory owner or POOLS_ADMINISTRATOR_ROLE role | Name | Type | Description | | ---- | ---- | ----------- | diff --git a/docs/Contracts/Core/interfaces/plugin/IAlgebraPlugin.md b/docs/Contracts/Core/interfaces/plugin/IAlgebraPlugin.md index c55b38334..54c80deb4 100644 --- a/docs/Contracts/Core/interfaces/plugin/IAlgebraPlugin.md +++ b/docs/Contracts/Core/interfaces/plugin/IAlgebraPlugin.md @@ -24,7 +24,7 @@ Returns plugin config | Name | Type | Description | | ---- | ---- | ----------- | -| [0] | uint16 | config Each bit of the config is responsible for enabling/disabling the hooks. The last bit indicates whether the plugin contains dynamic fees logic | +| [0] | uint16 | config Bitmap of enabled hooks and features, see `Plugins` | ### beforeInitialize diff --git a/docs/Contracts/Core/interfaces/pool/IAlgebraPoolEvents.md b/docs/Contracts/Core/interfaces/pool/IAlgebraPoolEvents.md index f26498263..38ea8baf5 100644 --- a/docs/Contracts/Core/interfaces/pool/IAlgebraPoolEvents.md +++ b/docs/Contracts/Core/interfaces/pool/IAlgebraPoolEvents.md @@ -237,7 +237,7 @@ Emitted when the community vault address changes event CommunityFeeTransfer(address communityVault, uint256 communityFeeAmount0, uint256 communityFeeAmount1) ``` -Emitted when community fees are distributed from the pool +Emitted when the community vault claims the community fees | Name | Type | Description | | ---- | ---- | ----------- | diff --git a/docs/Contracts/Core/interfaces/pool/IAlgebraPoolPermissionedActions.md b/docs/Contracts/Core/interfaces/pool/IAlgebraPoolPermissionedActions.md index b27523985..4cab6ef77 100644 --- a/docs/Contracts/Core/interfaces/pool/IAlgebraPoolPermissionedActions.md +++ b/docs/Contracts/Core/interfaces/pool/IAlgebraPoolPermissionedActions.md @@ -88,8 +88,8 @@ function setCommunityVault(address newCommunityVault) external Set new community fee vault address. Only factory owner or POOLS_ADMINISTRATOR_ROLE role -*Developer note: Community fee vault receives collected community fees. -**accumulated but not yet sent to the vault community fees once will be sent to the `newCommunityVault` address*** +*Developer note: The vault claims community fees with `claimCommunityFee`, unclaimed ones only by the `newCommunityVault`. +The zero address also sets the community fee to zero* | Name | Type | Description | | ---- | ---- | ----------- | @@ -102,8 +102,7 @@ function setFee(uint16 newFee) external ``` **Selector**: `0x8e005553` -Set new pool fee. Can be called by owner if dynamic fee is disabled. -Called by the plugin if dynamic fee is enabled +Set new pool fee if dynamic fee is disabled. Only factory owner or POOLS_ADMINISTRATOR_ROLE role | Name | Type | Description | | ---- | ---- | ----------- | diff --git a/docs/Contracts/Periphery/interfaces/IQuoterV2.md b/docs/Contracts/Periphery/interfaces/IQuoterV2.md index 80df1ec8c..b2510325b 100644 --- a/docs/Contracts/Periphery/interfaces/IQuoterV2.md +++ b/docs/Contracts/Periphery/interfaces/IQuoterV2.md @@ -68,7 +68,7 @@ Returns the amount out received for a given exact input swap without executing t | sqrtPriceX96AfterList | uint160[] | List of the sqrt price after the swap for each pool in the path | | initializedTicksCrossedList | uint32[] | List of the initialized ticks that the swap crossed for each pool in the path | | gasEstimate | uint256 | The estimate of the gas that the swap consumes | -| feeList | uint16[] | List of the fee values used for swaps in the path | +| feeList | uint16[] | The pool fees (`lastFee`), the applied ones may differ with dynamic fee | ### quoteExactInputSingle @@ -92,7 +92,7 @@ Returns the amount out received for a given exact input but for a swap of a sing | sqrtPriceX96After | uint160 | The sqrt price of the pool after the swap | | initializedTicksCrossed | uint32 | The number of initialized ticks that the swap crossed | | gasEstimate | uint256 | The estimate of the gas that the swap consumes | -| fee | uint16 | The fee value used for swap in the pool | +| fee | uint16 | The pool fee (`lastFee`), the applied one may differ with dynamic fee | ### quoteExactOutput @@ -117,7 +117,7 @@ Returns the amount in required for a given exact output swap without executing t | sqrtPriceX96AfterList | uint160[] | List of the sqrt price after the swap for each pool in the path | | initializedTicksCrossedList | uint32[] | List of the initialized ticks that the swap crossed for each pool in the path | | gasEstimate | uint256 | The estimate of the gas that the swap consumes | -| feeList | uint16[] | List of the fee values used for swaps in the path | +| feeList | uint16[] | The pool fees (`lastFee`), the applied ones may differ with dynamic fee | ### quoteExactOutputSingle @@ -141,5 +141,5 @@ Returns the amount in required to receive the given exact output amount but for | sqrtPriceX96After | uint160 | The sqrt price of the pool after the swap | | initializedTicksCrossed | uint32 | The number of initialized ticks that the swap crossed | | gasEstimate | uint256 | The estimate of the gas that the swap consumes | -| fee | uint16 | The fee value used for swap in the pool | +| fee | uint16 | The pool fee (`lastFee`), the applied one may differ with dynamic fee | diff --git a/docs/Contracts/Periphery/lens/QuoterV2.md b/docs/Contracts/Periphery/lens/QuoterV2.md index 75015a1de..8f5413009 100644 --- a/docs/Contracts/Periphery/lens/QuoterV2.md +++ b/docs/Contracts/Periphery/lens/QuoterV2.md @@ -71,7 +71,7 @@ Returns the amount out received for a given exact input but for a swap of a sing | sqrtPriceX96After | uint160 | The sqrt price of the pool after the swap | | initializedTicksCrossed | uint32 | The number of initialized ticks that the swap crossed | | gasEstimate | uint256 | The estimate of the gas that the swap consumes | -| fee | uint16 | The fee value used for swap in the pool | +| fee | uint16 | The pool fee (`lastFee`), the applied one may differ with dynamic fee | ### quoteExactInput @@ -96,7 +96,7 @@ Returns the amount out received for a given exact input swap without executing t | sqrtPriceX96AfterList | uint160[] | List of the sqrt price after the swap for each pool in the path | | initializedTicksCrossedList | uint32[] | List of the initialized ticks that the swap crossed for each pool in the path | | gasEstimate | uint256 | The estimate of the gas that the swap consumes | -| feeList | uint16[] | List of the fee values used for swaps in the path | +| feeList | uint16[] | The pool fees (`lastFee`), the applied ones may differ with dynamic fee | ### quoteExactOutputSingle @@ -120,7 +120,7 @@ Returns the amount in required to receive the given exact output amount but for | sqrtPriceX96After | uint160 | The sqrt price of the pool after the swap | | initializedTicksCrossed | uint32 | The number of initialized ticks that the swap crossed | | gasEstimate | uint256 | The estimate of the gas that the swap consumes | -| fee | uint16 | The fee value used for swap in the pool | +| fee | uint16 | The pool fee (`lastFee`), the applied one may differ with dynamic fee | ### quoteExactOutput @@ -145,5 +145,5 @@ Returns the amount in required for a given exact output swap without executing t | sqrtPriceX96AfterList | uint160[] | List of the sqrt price after the swap for each pool in the path | | initializedTicksCrossedList | uint32[] | List of the initialized ticks that the swap crossed for each pool in the path | | gasEstimate | uint256 | The estimate of the gas that the swap consumes | -| feeList | uint16[] | List of the fee values used for swaps in the path | +| feeList | uint16[] | The pool fees (`lastFee`), the applied ones may differ with dynamic fee | diff --git a/src/core/hardhat.config.ts b/src/core/hardhat.config.ts index 0f1ca8195..529674555 100644 --- a/src/core/hardhat.config.ts +++ b/src/core/hardhat.config.ts @@ -87,7 +87,8 @@ export default { return /^test[\\/]/.test(path) ? undefined : path.replace('.sol', '.md'); }, templates: '../../docs/doc_templates/public', - collapseNewlines: true, + // off: CRLF templates are not collapsed, so the output would depend on the line endings + collapseNewlines: false, }, outputValidator: { runOnCompile: false, diff --git a/src/farming/hardhat.config.ts b/src/farming/hardhat.config.ts index ee8036182..0f23a5b80 100644 --- a/src/farming/hardhat.config.ts +++ b/src/farming/hardhat.config.ts @@ -64,7 +64,8 @@ const config: HardhatUserConfig = { return /^test[\\/]/.test(path) ? undefined : path.replace('.sol', '.md'); }, templates: '../../docs/doc_templates/public', - collapseNewlines: true, + // off: CRLF templates are not collapsed, so the output would depend on the line endings + collapseNewlines: false, }, outputValidator: { runOnCompile: false, diff --git a/src/periphery/hardhat.config.ts b/src/periphery/hardhat.config.ts index 59bf4b87f..b6a377be5 100644 --- a/src/periphery/hardhat.config.ts +++ b/src/periphery/hardhat.config.ts @@ -121,7 +121,8 @@ export default { return /^test[\\/]/.test(path) ? undefined : path.replace('.sol', '.md'); }, templates: '../../docs/doc_templates/public', - collapseNewlines: true, + // off: CRLF templates are not collapsed, so the output would depend on the line endings + collapseNewlines: false, }, outputValidator: { runOnCompile: false,