From 49eddbb441b86ea0668a80efe7b556475c0fc0e4 Mon Sep 17 00:00:00 2001 From: Rooh Afza <96720500+r0ohafza@users.noreply.github.com> Date: Tue, 13 Feb 2024 20:57:33 -0800 Subject: [PATCH] chore: viaIR, PUSH0 and 0.8.23 (#6) * chore: viaIR, PUSH0 and 0.8.23 * ignore out-optimized * address comment --- .github/workflows/test.yml | 4 +- package.json | 2 + packages/splits-v2/.prettierignore | 1 + packages/splits-v2/foundry.toml | 46 ++++++------------- packages/splits-v2/package.json | 17 ++++--- packages/splits-v2/script/Base.s.sol | 2 +- .../splits-v2/script/SplitFactoryV2.s.sol | 2 +- .../splits-v2/script/SplitsWarehouse.s.sol | 2 +- packages/splits-v2/src/SplitsWarehouse.sol | 20 ++------ packages/splits-v2/src/interfaces/IERC165.sol | 2 +- .../splits-v2/src/interfaces/IERC6909.sol | 2 +- .../splits-v2/src/interfaces/IERC6909X.sol | 2 +- .../src/interfaces/IERC6909XCallback.sol | 2 +- .../src/interfaces/ISplitsWarehouse.sol | 2 +- packages/splits-v2/src/interfaces/IWETH9.sol | 2 +- packages/splits-v2/src/libraries/Cast.sol | 2 +- packages/splits-v2/src/libraries/Clone.sol | 2 +- packages/splits-v2/src/libraries/Math.sol | 12 ++--- packages/splits-v2/src/libraries/SplitV2.sol | 17 ++----- .../src/splitters/SplitFactoryV2.sol | 2 +- .../splits-v2/src/splitters/SplitWalletV2.sol | 14 ++---- packages/splits-v2/src/tokens/ERC6909.sol | 2 +- packages/splits-v2/src/tokens/ERC6909X.sol | 2 +- packages/splits-v2/src/utils/Ownable.sol | 2 +- packages/splits-v2/src/utils/Pausable.sol | 2 +- .../splits-v2/src/utils/UnorderedNonces.sol | 2 +- packages/splits-v2/src/utils/Wallet.sol | 8 +--- packages/splits-v2/test/Base.t.sol | 2 +- packages/splits-v2/test/erc6909/ERC6909.t.sol | 2 +- .../test/erc6909/ERC6909Callback.sol | 2 +- .../splits-v2/test/erc6909/ERC6909Test.sol | 2 +- .../test/splitters/SplitFactoryV2.t.sol | 2 +- .../test/splitters/SplitWalletV2.t.sol | 2 +- packages/splits-v2/test/utils/Address.sol | 2 +- packages/splits-v2/test/utils/ERC20.sol | 2 +- .../splits-v2/test/utils/ERC6909XUtils.sol | 2 +- packages/splits-v2/test/utils/Fuzzer.sol | 2 +- .../splits-v2/test/utils/MessageHashUtils.sol | 2 +- packages/splits-v2/test/utils/Ownable.t.sol | 2 +- packages/splits-v2/test/utils/Pausable.t.sol | 2 +- .../test/utils/ReentrantReceiver.sol | 2 +- packages/splits-v2/test/utils/WETH9.sol | 2 +- packages/splits-v2/test/utils/Wallet.t.sol | 2 +- .../test/warehouse/SplitsWarehouse.t.sol | 2 +- .../test/warehouse/SplitsWarehouseHandler.sol | 2 +- .../warehouse/SplitsWarehouseInvariant.t.sol | 2 +- turbo.json | 7 +++ 47 files changed, 89 insertions(+), 131 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 49d580d..51be04d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,10 +43,10 @@ jobs: run: pnpm install - name: Build - run: pnpm build + run: pnpm build:optimized - name: Lint run: pnpm lint - name: Test - run: pnpm test + run: pnpm test:optimized diff --git a/package.json b/package.json index 112b418..67b7366 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,13 @@ "private": true, "scripts": { "build": "turbo build", + "build:optimized": "turbo build:optimized", "dev": "turbo dev", "lint": "turbo lint", "lint:sol": "turbo lint:sol", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "test": "turbo test", + "test:optimized": "turbo test:optimized", "test:coverage": "turbo test:coverage" }, "devDependencies": { diff --git a/packages/splits-v2/.prettierignore b/packages/splits-v2/.prettierignore index 5991583..554aff2 100644 --- a/packages/splits-v2/.prettierignore +++ b/packages/splits-v2/.prettierignore @@ -5,6 +5,7 @@ coverage lib node_modules out +out-optimized # files *.env diff --git a/packages/splits-v2/foundry.toml b/packages/splits-v2/foundry.toml index 9823333..5131f62 100644 --- a/packages/splits-v2/foundry.toml +++ b/packages/splits-v2/foundry.toml @@ -1,16 +1,16 @@ [profile.default] auto_detect_solc = false -gas_reports = ["*"] +gas_reports = ["SplitsWarehouse", "SplitFactoryV2", "SplitWalletV2"] optimizer = true optimizer_runs = 5_000_000 out = "out" script = "script" -solc = "0.8.18" +solc = "0.8.23" src = "src" test = "test" allow_paths = ['../../node_modules'] fs_permissions = [{ access = "read-write", path = "./" }] - +evm_version = "shanghai" [profile.default.fuzz] max_test_rejects = 1_000_000 @@ -22,6 +22,18 @@ depth = 20 fail_on_revert = true runs = 20 +[profile.optimized] +out = "out-optimized" +via_ir = true + +[profile.test-optimized] +ffi = true +src = "test" + +[doc] +ignore = ["**/*.t.sol"] +out = "docs" + [profile.ci] fuzz = { runs = 10_000 } verbosity = 4 @@ -37,34 +49,6 @@ tab_width = 4 wrap_comments = true sort_imports = true -[profile.smt] -out = "out-optimized" -script = "src" -test = "src" -via_ir = false - -[profile.smt.model_checker] -engine = "chc" # constrained Horn clauses -invariants = ["contract", "reentrancy"] -show_proved_safe = true -show_unproved = true -show_unsupported = true -timeout = 100_000 # in milliseconds, per solving query -targets = [ - "assert", - "constantCondition", - "divByZero", - "outOfBounds", - "overflow", - "underflow", -] - -[profile.smt.model_checker.contracts] -"src/SplitsWarehouse.sol" = ["SplitsWarehouse"] -"src/splitters/SplitWalletV2.sol" = ["SplitWalletV2"] -"src/splitters/SplitFactoryV2.sol" = ["SplitFactoryV2"] - - [etherscan] mainnet = { key = "${ETHERSCAN_API_KEY}" } sepolia = { key = "${ETHERSCAN_API_KEY}" } diff --git a/packages/splits-v2/package.json b/packages/splits-v2/package.json index 6d2321b..99f3415 100644 --- a/packages/splits-v2/package.json +++ b/packages/splits-v2/package.json @@ -4,17 +4,20 @@ "description": "Splits v2 contracts", "scripts": { "build": "forge build", - "clean": "rm -rf cache out", - "lint": "pnpm lint:sol && prettier --check \"**/*.{json,md,yml}\"", + "build:optimized": "FOUNDRY_PROFILE=optimized forge build", + "clean": "rm -rf cache out out-optimized", + "lint": "pnpm lint:sol && pnpm run prettier:check", "lint:sol": "forge fmt --check && pnpm solhint {script,src,test}/**/*.sol", - "format": "prettier --write \"**/*.{json,md,yml}\" --ignore-path=.prettierignore", + "prettier:check": "prettier --check \"**/*.{json,md,svg,yml}\"", + "prettier:write": "prettier --write \"**/*.{json,md,svg,yml}\"", "test": "forge test -vvv", + "test:optimized": "pnpm run build:optimized && FOUNDRY_PROFILE=test-optimized forge test -vvv", "test:coverage": "forge coverage", "test:coverage:report": "forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage", - "deploy:SplitsWarehouse:test": "export DRY_RUN=true && source .env && forge script script/SplitsWarehouse.s.sol:SplitsWarehouseScript --account SPLITS_V2_DEPLOYER -vvvvv --rpc-url ", - "deploy:SplitsWarehouse": "export DRY_RUN=false && source .env && forge script script/SplitsWarehouse.s.sol:SplitsWarehouseScript --account SPLITS_V2_DEPLOYER --broadcast --verify --verifier sourcify -vvvvv --rpc-url ", - "deploy:SplitFactoryV2:test": "export DRY_RUN=true && source .env && forge script script/SplitFactoryV2.s.sol:SplitFactoryV2Script --account SPLITS_V2_DEPLOYER -vvvvv --rpc-url ", - "deploy:SplitFactoryV2": "export DRY_RUN=false && source .env && forge script script/SplitFactoryV2.s.sol:SplitFactoryV2Script --account SPLITS_V2_DEPLOYER --broadcast --verify --verifier sourcify -vvvvv --rpc-url " + "deploy:SplitsWarehouse:test": "export DRY_RUN=true && source .env && FOUNDRY_PROFILE=optimized forge script script/SplitsWarehouse.s.sol:SplitsWarehouseScript --account SPLITS_V2_DEPLOYER -vvvvv --rpc-url ", + "deploy:SplitsWarehouse": "export DRY_RUN=false && source .env && FOUNDRY_PROFILE=optimized forge script script/SplitsWarehouse.s.sol:SplitsWarehouseScript --account SPLITS_V2_DEPLOYER --broadcast --verify --verifier sourcify -vvvvv --rpc-url ", + "deploy:SplitFactoryV2:test": "export DRY_RUN=true && source .env && FOUNDRY_PROFILE=optimized forge script script/SplitFactoryV2.s.sol:SplitFactoryV2Script --account SPLITS_V2_DEPLOYER -vvvvv --rpc-url ", + "deploy:SplitFactoryV2": "export DRY_RUN=false && source .env && FOUNDRY_PROFILE=optimized forge script script/SplitFactoryV2.s.sol:SplitFactoryV2Script --account SPLITS_V2_DEPLOYER --broadcast --verify --verifier sourcify -vvvvv --rpc-url " }, "keywords": [], "author": "@splits", diff --git a/packages/splits-v2/script/Base.s.sol b/packages/splits-v2/script/Base.s.sol index 1939b19..780710a 100644 --- a/packages/splits-v2/script/Base.s.sol +++ b/packages/splits-v2/script/Base.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { ICreateX } from "./ICreateX.sol"; import { Script } from "forge-std/Script.sol"; diff --git a/packages/splits-v2/script/SplitFactoryV2.s.sol b/packages/splits-v2/script/SplitFactoryV2.s.sol index 4500eb5..870e74e 100644 --- a/packages/splits-v2/script/SplitFactoryV2.s.sol +++ b/packages/splits-v2/script/SplitFactoryV2.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { SplitFactoryV2 } from "../src/splitters/SplitFactoryV2.sol"; diff --git a/packages/splits-v2/script/SplitsWarehouse.s.sol b/packages/splits-v2/script/SplitsWarehouse.s.sol index e05609f..d52b063 100644 --- a/packages/splits-v2/script/SplitsWarehouse.s.sol +++ b/packages/splits-v2/script/SplitsWarehouse.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { SplitsWarehouse } from "../src/SplitsWarehouse.sol"; diff --git a/packages/splits-v2/src/SplitsWarehouse.sol b/packages/splits-v2/src/SplitsWarehouse.sol index cf5560b..82bd4a0 100644 --- a/packages/splits-v2/src/SplitsWarehouse.sol +++ b/packages/splits-v2/src/SplitsWarehouse.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-or-later // license? -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { Cast } from "./libraries/Cast.sol"; import { Math } from "./libraries/Math.sol"; @@ -182,14 +182,10 @@ contract SplitsWarehouse is ERC6909X { uint256 amount; uint256 tokenId = _token.toUint256(); uint256 length = _receivers.length; - for (uint256 i; i < length;) { + for (uint256 i; i < length; ++i) { amount = _amounts[i]; sum += amount; _mint(_receivers[i], tokenId, amount); - - unchecked { - ++i; - } } if (_token == NATIVE_TOKEN) { @@ -239,13 +235,9 @@ contract SplitsWarehouse is ERC6909X { uint256 reward; uint256 length = _tokens.length; - for (uint256 i; i < length;) { + for (uint256 i; i < length; ++i) { reward = _amounts[i] * config.incentive / PERCENTAGE_SCALE; _withdraw(_owner, _tokens[i], _amounts[i], _withdrawer, reward); - - unchecked { - ++i; - } } } @@ -263,17 +255,13 @@ contract SplitsWarehouse is ERC6909X { uint256 amount; address receiver; uint256 length = _receivers.length; - for (uint256 i; i < length;) { + for (uint256 i; i < length; ++i) { receiver = _receivers[i]; amount = _amounts[i]; balanceOf[receiver][tokenId] += amount; emit Transfer(msg.sender, msg.sender, receiver, tokenId, amount); sum += amount; - - unchecked { - ++i; - } } balanceOf[msg.sender][tokenId] -= sum; } diff --git a/packages/splits-v2/src/interfaces/IERC165.sol b/packages/splits-v2/src/interfaces/IERC165.sol index 46c35a2..fee421f 100644 --- a/packages/splits-v2/src/interfaces/IERC165.sol +++ b/packages/splits-v2/src/interfaces/IERC165.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; interface IERC165 { /// @notice Checks if a contract implements an interface. diff --git a/packages/splits-v2/src/interfaces/IERC6909.sol b/packages/splits-v2/src/interfaces/IERC6909.sol index 2b6d276..417c6cb 100644 --- a/packages/splits-v2/src/interfaces/IERC6909.sol +++ b/packages/splits-v2/src/interfaces/IERC6909.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { IERC165 } from "./IERC165.sol"; diff --git a/packages/splits-v2/src/interfaces/IERC6909X.sol b/packages/splits-v2/src/interfaces/IERC6909X.sol index 1c75879..7757ee8 100644 --- a/packages/splits-v2/src/interfaces/IERC6909X.sol +++ b/packages/splits-v2/src/interfaces/IERC6909X.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { IERC5267 } from "@openzeppelin/contracts/interfaces/IERC5267.sol"; diff --git a/packages/splits-v2/src/interfaces/IERC6909XCallback.sol b/packages/splits-v2/src/interfaces/IERC6909XCallback.sol index bdab42f..927051e 100644 --- a/packages/splits-v2/src/interfaces/IERC6909XCallback.sol +++ b/packages/splits-v2/src/interfaces/IERC6909XCallback.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; interface IERC6909XCallback { function onTemporaryApprove( diff --git a/packages/splits-v2/src/interfaces/ISplitsWarehouse.sol b/packages/splits-v2/src/interfaces/ISplitsWarehouse.sol index 969d068..d43f03e 100644 --- a/packages/splits-v2/src/interfaces/ISplitsWarehouse.sol +++ b/packages/splits-v2/src/interfaces/ISplitsWarehouse.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { IERC6909 } from "./IERC6909.sol"; diff --git a/packages/splits-v2/src/interfaces/IWETH9.sol b/packages/splits-v2/src/interfaces/IWETH9.sol index c469cc9..cd61601 100644 --- a/packages/splits-v2/src/interfaces/IWETH9.sol +++ b/packages/splits-v2/src/interfaces/IWETH9.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; interface IWETH9 { function deposit() external payable; diff --git a/packages/splits-v2/src/libraries/Cast.sol b/packages/splits-v2/src/libraries/Cast.sol index d356055..c759a95 100644 --- a/packages/splits-v2/src/libraries/Cast.sol +++ b/packages/splits-v2/src/libraries/Cast.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; library Cast { error Overflow(); diff --git a/packages/splits-v2/src/libraries/Clone.sol b/packages/splits-v2/src/libraries/Clone.sol index b7139b2..da46b06 100644 --- a/packages/splits-v2/src/libraries/Clone.sol +++ b/packages/splits-v2/src/libraries/Clone.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; /** * @title Modified minimal proxy diff --git a/packages/splits-v2/src/libraries/Math.sol b/packages/splits-v2/src/libraries/Math.sol index 52cb4f9..ae16fb9 100644 --- a/packages/splits-v2/src/libraries/Math.sol +++ b/packages/splits-v2/src/libraries/Math.sol @@ -1,22 +1,16 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; library Math { function sum(uint256[] calldata values) internal pure returns (uint256 total) { - for (uint256 i = 0; i < values.length;) { + for (uint256 i; i < values.length; ++i) { total += values[i]; - unchecked { - ++i; - } } } function sumMem(uint256[] memory values) internal pure returns (uint256 total) { - for (uint256 i = 0; i < values.length;) { + for (uint256 i; i < values.length; ++i) { total += values[i]; - unchecked { - ++i; - } } } diff --git a/packages/splits-v2/src/libraries/SplitV2.sol b/packages/splits-v2/src/libraries/SplitV2.sol index 5abf73c..db1d966 100644 --- a/packages/splits-v2/src/libraries/SplitV2.sol +++ b/packages/splits-v2/src/libraries/SplitV2.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; library SplitV2Lib { /* -------------------------------------------------------------------------- */ @@ -56,11 +56,8 @@ library SplitV2Lib { } uint256 totalAllocation; - for (uint256 i; i < numOfRecipients;) { + for (uint256 i; i < numOfRecipients; ++i) { totalAllocation += _split.allocations[i]; - unchecked { - ++i; - } } if (totalAllocation != _split.totalAllocation) revert InvalidSplit_TotalAllocationMismatch(); } @@ -79,11 +76,8 @@ library SplitV2Lib { distributorReward = _amount * _split.distributionIncentive / PERCENTAGE_SCALE; _amount -= distributorReward; - for (uint256 i; i < numOfRecipients;) { + for (uint256 i; i < numOfRecipients; ++i) { amounts[i] = _amount * _split.allocations[i] / _split.totalAllocation; - unchecked { - ++i; - } } } @@ -101,11 +95,8 @@ library SplitV2Lib { distributorReward = _amount * _split.distributionIncentive / PERCENTAGE_SCALE; _amount -= distributorReward; - for (uint256 i; i < numOfRecipients;) { + for (uint256 i; i < numOfRecipients; ++i) { amounts[i] = _amount * _split.allocations[i] / _split.totalAllocation; - unchecked { - ++i; - } } } diff --git a/packages/splits-v2/src/splitters/SplitFactoryV2.sol b/packages/splits-v2/src/splitters/SplitFactoryV2.sol index a29ec64..78b2a24 100644 --- a/packages/splits-v2/src/splitters/SplitFactoryV2.sol +++ b/packages/splits-v2/src/splitters/SplitFactoryV2.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; // TODO: do we want to use our clone or the minimal standard? import { Clone } from "../libraries/Clone.sol"; diff --git a/packages/splits-v2/src/splitters/SplitWalletV2.sol b/packages/splits-v2/src/splitters/SplitWalletV2.sol index 6d7d7b2..5fe1423 100644 --- a/packages/splits-v2/src/splitters/SplitWalletV2.sol +++ b/packages/splits-v2/src/splitters/SplitWalletV2.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { ISplitsWarehouse } from "../interfaces/ISplitsWarehouse.sol"; @@ -222,28 +222,20 @@ contract SplitWalletV2 is Wallet { uint256 allocatedAmount; if (_token == NATIVE_TOKEN) { - for (uint256 i; i < numOfRecipients;) { + for (uint256 i; i < numOfRecipients; ++i) { allocatedAmount = _split.calculateAllocatedAmount(amountToDistribute, i); if (!_split.recipients[i].trySafeTransferETH(allocatedAmount, SafeTransferLib.GAS_STIPEND_NO_GRIEF)) { SPLITS_WAREHOUSE.deposit{ value: allocatedAmount }(_split.recipients[i], _token, allocatedAmount); } - - unchecked { - ++i; - } } if (distributorReward > 0) _distributor.safeTransferETH(distributorReward); } else { - for (uint256 i; i < numOfRecipients;) { + for (uint256 i; i < numOfRecipients; ++i) { allocatedAmount = _split.calculateAllocatedAmount(amountToDistribute, i); IERC20(_token).safeTransfer(_split.recipients[i], allocatedAmount); - - unchecked { - ++i; - } } if (distributorReward > 0) IERC20(_token).safeTransfer(_distributor, distributorReward); diff --git a/packages/splits-v2/src/tokens/ERC6909.sol b/packages/splits-v2/src/tokens/ERC6909.sol index bdc3df7..851f582 100644 --- a/packages/splits-v2/src/tokens/ERC6909.sol +++ b/packages/splits-v2/src/tokens/ERC6909.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { IERC165 } from "../interfaces/IERC165.sol"; import { IERC6909 } from "../interfaces/IERC6909.sol"; diff --git a/packages/splits-v2/src/tokens/ERC6909X.sol b/packages/splits-v2/src/tokens/ERC6909X.sol index 411fa23..8070140 100644 --- a/packages/splits-v2/src/tokens/ERC6909X.sol +++ b/packages/splits-v2/src/tokens/ERC6909X.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { IERC6909X } from "../interfaces/IERC6909X.sol"; import { IERC6909XCallback } from "../interfaces/IERC6909XCallback.sol"; diff --git a/packages/splits-v2/src/utils/Ownable.sol b/packages/splits-v2/src/utils/Ownable.sol index d0493ac..6d35ad8 100644 --- a/packages/splits-v2/src/utils/Ownable.sol +++ b/packages/splits-v2/src/utils/Ownable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; /// @title Ownable Implementation /// @author 0xSplits diff --git a/packages/splits-v2/src/utils/Pausable.sol b/packages/splits-v2/src/utils/Pausable.sol index c6183f4..5ee4e53 100644 --- a/packages/splits-v2/src/utils/Pausable.sol +++ b/packages/splits-v2/src/utils/Pausable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { Ownable } from "./Ownable.sol"; diff --git a/packages/splits-v2/src/utils/UnorderedNonces.sol b/packages/splits-v2/src/utils/UnorderedNonces.sol index ec5df5b..159f2dc 100644 --- a/packages/splits-v2/src/utils/UnorderedNonces.sol +++ b/packages/splits-v2/src/utils/UnorderedNonces.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; /** * @title Track user nonces. diff --git a/packages/splits-v2/src/utils/Wallet.sol b/packages/splits-v2/src/utils/Wallet.sol index 185987e..4891c7c 100644 --- a/packages/splits-v2/src/utils/Wallet.sol +++ b/packages/splits-v2/src/utils/Wallet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { Pausable } from "./Pausable.sol"; @@ -64,7 +64,7 @@ abstract contract Wallet is Pausable { returnData = new bytes[](length); bool success; - for (uint256 i; i < length;) { + for (uint256 i; i < length; ++i) { Call calldata calli = _calls[i]; if (calli.to.code.length == 0) { @@ -75,10 +75,6 @@ abstract contract Wallet is Pausable { // solhint-disable-next-line require(success, string(returnData[i])); - - unchecked { - ++i; - } } emit ExecCalls(_calls); diff --git a/packages/splits-v2/test/Base.t.sol b/packages/splits-v2/test/Base.t.sol index 9e6ff3e..6cfd668 100644 --- a/packages/splits-v2/test/Base.t.sol +++ b/packages/splits-v2/test/Base.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { SplitsWarehouse } from "../src/SplitsWarehouse.sol"; import { Cast } from "../src/libraries/Cast.sol"; diff --git a/packages/splits-v2/test/erc6909/ERC6909.t.sol b/packages/splits-v2/test/erc6909/ERC6909.t.sol index 1d3fe04..3333f22 100644 --- a/packages/splits-v2/test/erc6909/ERC6909.t.sol +++ b/packages/splits-v2/test/erc6909/ERC6909.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { BaseTest } from "../Base.t.sol"; diff --git a/packages/splits-v2/test/erc6909/ERC6909Callback.sol b/packages/splits-v2/test/erc6909/ERC6909Callback.sol index b64b93f..f6f13d6 100644 --- a/packages/splits-v2/test/erc6909/ERC6909Callback.sol +++ b/packages/splits-v2/test/erc6909/ERC6909Callback.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { SplitsWarehouse } from "../../src/SplitsWarehouse.sol"; import { IERC6909XCallback } from "../../src/interfaces/IERC6909XCallback.sol"; diff --git a/packages/splits-v2/test/erc6909/ERC6909Test.sol b/packages/splits-v2/test/erc6909/ERC6909Test.sol index c3125b6..64b202c 100644 --- a/packages/splits-v2/test/erc6909/ERC6909Test.sol +++ b/packages/splits-v2/test/erc6909/ERC6909Test.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { Cast } from "../../src/libraries/Cast.sol"; import { ERC6909X } from "../../src/tokens/ERC6909X.sol"; diff --git a/packages/splits-v2/test/splitters/SplitFactoryV2.t.sol b/packages/splits-v2/test/splitters/SplitFactoryV2.t.sol index 648b21a..d9d1130 100644 --- a/packages/splits-v2/test/splitters/SplitFactoryV2.t.sol +++ b/packages/splits-v2/test/splitters/SplitFactoryV2.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { SplitV2Lib } from "../../src/libraries/SplitV2.sol"; import { SplitWalletV2 } from "../../src/splitters/SplitWalletV2.sol"; diff --git a/packages/splits-v2/test/splitters/SplitWalletV2.t.sol b/packages/splits-v2/test/splitters/SplitWalletV2.t.sol index 74f7780..a1ea4e3 100644 --- a/packages/splits-v2/test/splitters/SplitWalletV2.t.sol +++ b/packages/splits-v2/test/splitters/SplitWalletV2.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { Clone } from "../../src/libraries/Clone.sol"; import { SplitV2Lib } from "../../src/libraries/SplitV2.sol"; diff --git a/packages/splits-v2/test/utils/Address.sol b/packages/splits-v2/test/utils/Address.sol index 5a9aae7..e731c3b 100644 --- a/packages/splits-v2/test/utils/Address.sol +++ b/packages/splits-v2/test/utils/Address.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/packages/splits-v2/test/utils/ERC20.sol b/packages/splits-v2/test/utils/ERC20.sol index f15f8ae..be6822e 100644 --- a/packages/splits-v2/test/utils/ERC20.sol +++ b/packages/splits-v2/test/utils/ERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { ERC20 as AbstractERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/packages/splits-v2/test/utils/ERC6909XUtils.sol b/packages/splits-v2/test/utils/ERC6909XUtils.sol index a0b626f..6b24489 100644 --- a/packages/splits-v2/test/utils/ERC6909XUtils.sol +++ b/packages/splits-v2/test/utils/ERC6909XUtils.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { MessageHashUtils } from "./MessageHashUtils.sol"; diff --git a/packages/splits-v2/test/utils/Fuzzer.sol b/packages/splits-v2/test/utils/Fuzzer.sol index e160e10..1f9cb35 100644 --- a/packages/splits-v2/test/utils/Fuzzer.sol +++ b/packages/splits-v2/test/utils/Fuzzer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; contract Fuzzer { error LengthMismatch(); diff --git a/packages/splits-v2/test/utils/MessageHashUtils.sol b/packages/splits-v2/test/utils/MessageHashUtils.sol index 427407c..fbaf01a 100644 --- a/packages/splits-v2/test/utils/MessageHashUtils.sol +++ b/packages/splits-v2/test/utils/MessageHashUtils.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; /* solhint-disable */ /** diff --git a/packages/splits-v2/test/utils/Ownable.t.sol b/packages/splits-v2/test/utils/Ownable.t.sol index a05c0eb..042c9ba 100644 --- a/packages/splits-v2/test/utils/Ownable.t.sol +++ b/packages/splits-v2/test/utils/Ownable.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { Ownable } from "../../src/utils/Ownable.sol"; import { BaseTest } from "../Base.t.sol"; diff --git a/packages/splits-v2/test/utils/Pausable.t.sol b/packages/splits-v2/test/utils/Pausable.t.sol index b40ff9c..ded020e 100644 --- a/packages/splits-v2/test/utils/Pausable.t.sol +++ b/packages/splits-v2/test/utils/Pausable.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { Pausable } from "../../src/utils/Pausable.sol"; import { BaseTest } from "../Base.t.sol"; diff --git a/packages/splits-v2/test/utils/ReentrantReceiver.sol b/packages/splits-v2/test/utils/ReentrantReceiver.sol index 3b46be2..0853d01 100644 --- a/packages/splits-v2/test/utils/ReentrantReceiver.sol +++ b/packages/splits-v2/test/utils/ReentrantReceiver.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { SplitsWarehouse } from "../../src/SplitsWarehouse.sol"; diff --git a/packages/splits-v2/test/utils/WETH9.sol b/packages/splits-v2/test/utils/WETH9.sol index 5bdf338..73bdb0c 100644 --- a/packages/splits-v2/test/utils/WETH9.sol +++ b/packages/splits-v2/test/utils/WETH9.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; /* solhint-disable */ contract WETH9 { diff --git a/packages/splits-v2/test/utils/Wallet.t.sol b/packages/splits-v2/test/utils/Wallet.t.sol index 5a7d2ee..86cc539 100644 --- a/packages/splits-v2/test/utils/Wallet.t.sol +++ b/packages/splits-v2/test/utils/Wallet.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { Ownable } from "../../src/utils/Ownable.sol"; import { Wallet } from "../../src/utils/Wallet.sol"; diff --git a/packages/splits-v2/test/warehouse/SplitsWarehouse.t.sol b/packages/splits-v2/test/warehouse/SplitsWarehouse.t.sol index f4f1dac..6c0ed43 100644 --- a/packages/splits-v2/test/warehouse/SplitsWarehouse.t.sol +++ b/packages/splits-v2/test/warehouse/SplitsWarehouse.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { SplitsWarehouse } from "../../src/SplitsWarehouse.sol"; import { Math } from "../../src/libraries/Math.sol"; diff --git a/packages/splits-v2/test/warehouse/SplitsWarehouseHandler.sol b/packages/splits-v2/test/warehouse/SplitsWarehouseHandler.sol index c0a1d09..49037a0 100644 --- a/packages/splits-v2/test/warehouse/SplitsWarehouseHandler.sol +++ b/packages/splits-v2/test/warehouse/SplitsWarehouseHandler.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { SplitsWarehouse } from "../../src/SplitsWarehouse.sol"; diff --git a/packages/splits-v2/test/warehouse/SplitsWarehouseInvariant.t.sol b/packages/splits-v2/test/warehouse/SplitsWarehouseInvariant.t.sol index 2d926a4..f8754eb 100644 --- a/packages/splits-v2/test/warehouse/SplitsWarehouseInvariant.t.sol +++ b/packages/splits-v2/test/warehouse/SplitsWarehouseInvariant.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.8.18; +pragma solidity ^0.8.23; import { Cast } from "../../src/libraries/Cast.sol"; import { SplitsWarehouseHandler } from "./SplitsWarehouseHandler.sol"; diff --git a/turbo.json b/turbo.json index aef3f68..820839d 100644 --- a/turbo.json +++ b/turbo.json @@ -6,6 +6,10 @@ "dependsOn": ["^build"], "outputs": [".next/**", "!.next/cache/**"] }, + "build:optimized": { + "dependsOn": ["^build:optimized"], + "outputs": [".next/**", "!.next/cache/**"] + }, "lint": { "dependsOn": ["^lint"] }, @@ -15,6 +19,9 @@ "test": { "dependsOn": ["^test"] }, + "test:optimized": { + "dependsOn": ["^test:optimized"] + }, "dev": { "cache": false, "persistent": true