diff --git a/contracts/core/Allo.md b/contracts/core/Allo.md index a7da43a16..dcf75ef94 100644 --- a/contracts/core/Allo.md +++ b/contracts/core/Allo.md @@ -167,7 +167,7 @@ sequenceDiagram ## Smart Contract Overview * **License:** The contract is licensed under the AGPL-3.0-only license. -* **Solidity Version:** The contract is written in Solidity version 0.8.19. +* **Solidity Version:** The contract supports Solidity versions ^0.8.19, but is developed in Solidity version 0.8.22. * **Inheritance:** The contract inherits from several other contracts: `Initializable`, `Ownable`, `AccessControl`, `IAllo`, `Native`, and `Transfer`. ### Storage Variables diff --git a/contracts/core/Allo.sol b/contracts/core/Allo.sol index 2e7fb5923..7e69ffd59 100644 --- a/contracts/core/Allo.sol +++ b/contracts/core/Allo.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import "solady/auth/Ownable.sol"; @@ -269,12 +269,8 @@ contract Allo is IAllo, Native, Initializable, Ownable, AccessControlUpgradeable /// @param _poolId ID of the pool /// @param _managers The addresses to add function addPoolManagers(uint256 _poolId, address[] calldata _managers) public onlyPoolAdmin(_poolId) { - for (uint256 i; i < _managers.length;) { + for (uint256 i; i < _managers.length; ++i) { _addPoolManager(_poolId, _managers[i]); - - unchecked { - ++i; - } } } @@ -283,12 +279,8 @@ contract Allo is IAllo, Native, Initializable, Ownable, AccessControlUpgradeable /// @param _poolId ID of the pool /// @param _managers The addresses to remove function removePoolManagers(uint256 _poolId, address[] calldata _managers) public onlyPoolAdmin(_poolId) { - for (uint256 i; i < _managers.length;) { + for (uint256 i; i < _managers.length; ++i) { _revokeRole(pools[_poolId].managerRole, _managers[i]); - - unchecked { - ++i; - } } } @@ -296,11 +288,8 @@ contract Allo is IAllo, Native, Initializable, Ownable, AccessControlUpgradeable /// @param _poolIds IDs of the pools /// @param _managers The addresses to add function addPoolManagersInMultiplePools(uint256[] calldata _poolIds, address[] calldata _managers) external { - for (uint256 i; i < _poolIds.length;) { + for (uint256 i; i < _poolIds.length; ++i) { addPoolManagers(_poolIds[i], _managers); - unchecked { - ++i; - } } } @@ -308,11 +297,8 @@ contract Allo is IAllo, Native, Initializable, Ownable, AccessControlUpgradeable /// @param _poolIds IDs of the pools /// @param _managers The addresses to remove function removePoolManagersInMultiplePools(uint256[] calldata _poolIds, address[] calldata _managers) external { - for (uint256 i; i < _poolIds.length;) { + for (uint256 i; i < _poolIds.length; ++i) { removePoolManagers(_poolIds[i], _managers); - unchecked { - ++i; - } } } @@ -368,11 +354,8 @@ contract Allo is IAllo, Native, Initializable, Ownable, AccessControlUpgradeable if (poolIdLength != _data.length || poolIdLength != _recipientAddresses.length) revert MISMATCH(); // Loop through the '_poolIds' & '_data' and call the 'strategy.register()' function - for (uint256 i; i < poolIdLength;) { + for (uint256 i; i < poolIdLength; ++i) { recipientIds[i] = pools[_poolIds[i]].strategy.register(_recipientAddresses[i], _data[i], _msgSender()); - unchecked { - ++i; - } } // Return the recipientIds that have been registered @@ -438,12 +421,9 @@ contract Allo is IAllo, Native, Initializable, Ownable, AccessControlUpgradeable // Loop through the _poolIds & _datas and call the internal _allocate() function uint256 totalValue; address msgSender = _msgSender(); - for (uint256 i; i < numPools;) { + for (uint256 i; i < numPools; ++i) { _allocate(_poolIds[i], _recipients[i], _amounts[i], _datas[i], _values[i], msgSender); totalValue += _values[i]; - unchecked { - ++i; - } } // Reverts if the sum of all the allocated values is different than 'msg.value' with 'MISMATCH()' error if (totalValue != msg.value) revert ETH_MISMATCH(); @@ -548,13 +528,8 @@ contract Allo is IAllo, Native, Initializable, Ownable, AccessControlUpgradeable // grant pool managers roles uint256 managersLength = _managers.length; - for (uint256 i; i < managersLength;) { - address manager = _managers[i]; - _addPoolManager(poolId, manager); - - unchecked { - ++i; - } + for (uint256 i; i < managersLength; ++i) { + _addPoolManager(poolId, _managers[i]); } if (baseFee > 0) { diff --git a/contracts/core/Anchor.md b/contracts/core/Anchor.md index cac9d09e6..6840e9ae1 100644 --- a/contracts/core/Anchor.md +++ b/contracts/core/Anchor.md @@ -19,7 +19,7 @@ The `Anchor` contract serves as a crucial utility within the Allo ecosystem, fac ## Smart Contract Overview * **License:** The `Anchor` contract is licensed under the AGPL-3.0-only license, promoting the use of open-source software. -* **Solidity Version:** Developed using Solidity version 0.8.19, harnessing the latest advancements in Ethereum smart contract technology. +* **Solidity Version:** Supports Solidity versions ^0.8.19, but developed using Solidity version 0.8.22, harnessing the latest advancements in Ethereum smart contract technology. ### Storage Variables diff --git a/contracts/core/Anchor.sol b/contracts/core/Anchor.sol index f5f0864d8..d31655b71 100644 --- a/contracts/core/Anchor.sol +++ b/contracts/core/Anchor.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import "openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol"; import "openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol"; diff --git a/contracts/core/Registry.md b/contracts/core/Registry.md index 20a09ae74..380bee374 100644 --- a/contracts/core/Registry.md +++ b/contracts/core/Registry.md @@ -102,7 +102,7 @@ sequenceDiagram ## Smart Contract Overview * **License:** The `Registry` contract adheres to the MIT License, promoting permissive open-source usage. -* **Solidity Version:** Developed using Solidity version 0.8.19, harnessing the latest advancements in Ethereum smart contract technology. +* **Solidity Version:** Supports Solidity versions ^0.8.19, but developed using Solidity version 0.8.22, harnessing the latest advancements in Ethereum smart contract technology. * **External Libraries:** The contract incorporates the `AccessControl` and `CREATE3` external libraries, enhancing access control and facilitating contract deployment. * **Interfaces:** The contract utilizes the `IRegistry` interface for communication with external components. diff --git a/contracts/core/Registry.sol b/contracts/core/Registry.sol index 5b6847708..d900fff02 100644 --- a/contracts/core/Registry.sol +++ b/contracts/core/Registry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import "openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol"; @@ -153,7 +153,7 @@ contract Registry is IRegistry, Initializable, AccessControlUpgradeable, Errors revert UNAUTHORIZED(); } - for (uint256 i; i < memberLength;) { + for (uint256 i; i < memberLength; ++i) { address member = _members[i]; // Will revert if any of the addresses are a zero address @@ -161,9 +161,6 @@ contract Registry is IRegistry, Initializable, AccessControlUpgradeable, Errors // Grant the role to the member and emit the event for each member _grantRole(profileId, member); - unchecked { - ++i; - } } // Emit the event that the profile was created @@ -291,7 +288,7 @@ contract Registry is IRegistry, Initializable, AccessControlUpgradeable, Errors uint256 memberLength = _members.length; // Loop through the members and add them to the profile by granting the role - for (uint256 i; i < memberLength;) { + for (uint256 i; i < memberLength; ++i) { address member = _members[i]; // Will revert if any of the addresses are a zero address @@ -299,9 +296,6 @@ contract Registry is IRegistry, Initializable, AccessControlUpgradeable, Errors // Grant the role to the member and emit the event for each member _grantRole(_profileId, member); - unchecked { - ++i; - } } } @@ -313,12 +307,9 @@ contract Registry is IRegistry, Initializable, AccessControlUpgradeable, Errors uint256 memberLength = _members.length; // Loop through the members and remove them from the profile by revoking the role - for (uint256 i; i < memberLength;) { + for (uint256 i; i < memberLength; ++i) { // Revoke the role from the member and emit the event for each member _revokeRole(_profileId, _members[i]); - unchecked { - ++i; - } } } diff --git a/contracts/core/interfaces/IBaseStrategy.sol b/contracts/core/interfaces/IBaseStrategy.sol index 74644125a..92eddbf2e 100644 --- a/contracts/core/interfaces/IBaseStrategy.sol +++ b/contracts/core/interfaces/IBaseStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {IAllo} from "./IAllo.sol"; diff --git a/contracts/core/libraries/Clone.sol b/contracts/core/libraries/Clone.sol index afc3b3f89..eeabf95e1 100644 --- a/contracts/core/libraries/Clone.sol +++ b/contracts/core/libraries/Clone.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import "openzeppelin-contracts-upgradeable/contracts/proxy/ClonesUpgradeable.sol"; diff --git a/contracts/core/libraries/Errors.sol b/contracts/core/libraries/Errors.sol index 8c7353827..fe4d2b3c7 100644 --- a/contracts/core/libraries/Errors.sol +++ b/contracts/core/libraries/Errors.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ // ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ diff --git a/contracts/core/libraries/Metadata.sol b/contracts/core/libraries/Metadata.sol index 7c0d28cdb..2bcee3c42 100644 --- a/contracts/core/libraries/Metadata.sol +++ b/contracts/core/libraries/Metadata.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ // ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ diff --git a/contracts/core/libraries/Native.sol b/contracts/core/libraries/Native.sol index 53ea991f6..59240a9bd 100644 --- a/contracts/core/libraries/Native.sol +++ b/contracts/core/libraries/Native.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ // ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ diff --git a/contracts/core/libraries/QFHelper.sol b/contracts/core/libraries/QFHelper.sol index 3837748cd..819c1f56f 100644 --- a/contracts/core/libraries/QFHelper.sol +++ b/contracts/core/libraries/QFHelper.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import "solady/utils/FixedPointMathLib.sol"; diff --git a/contracts/core/libraries/QVHelper.sol b/contracts/core/libraries/QVHelper.sol index 05f57d86e..89953f946 100644 --- a/contracts/core/libraries/QVHelper.sol +++ b/contracts/core/libraries/QVHelper.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import "solady/utils/FixedPointMathLib.sol"; diff --git a/contracts/core/libraries/Transfer.sol b/contracts/core/libraries/Transfer.sol index d1056425c..730ba8787 100644 --- a/contracts/core/libraries/Transfer.sol +++ b/contracts/core/libraries/Transfer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {SafeTransferLib} from "solady/utils/SafeTransferLib.sol"; diff --git a/contracts/extensions/EASGatingExtension.sol b/contracts/extensions/EASGatingExtension.sol index 50ead14e7..c6350a8e1 100644 --- a/contracts/extensions/EASGatingExtension.sol +++ b/contracts/extensions/EASGatingExtension.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; /// External Libraries import {IEAS, Attestation} from "eas-contracts/IEAS.sol"; diff --git a/contracts/extensions/NFTGatingExtension.sol b/contracts/extensions/NFTGatingExtension.sol index 9f4d6e394..1bc4b15ba 100644 --- a/contracts/extensions/NFTGatingExtension.sol +++ b/contracts/extensions/NFTGatingExtension.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; /// External Libraries import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; diff --git a/contracts/extensions/TokenGatingExtension.sol b/contracts/extensions/TokenGatingExtension.sol index 99d6277c3..b068f008a 100644 --- a/contracts/extensions/TokenGatingExtension.sol +++ b/contracts/extensions/TokenGatingExtension.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; /// External Libraries import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/contracts/extensions/contracts/MilestonesExtension.sol b/contracts/extensions/contracts/MilestonesExtension.sol index 3ad37e9f1..d4710f875 100644 --- a/contracts/extensions/contracts/MilestonesExtension.sol +++ b/contracts/extensions/contracts/MilestonesExtension.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Interfaces import {IMilestonesExtension} from "../interfaces/IMilestonesExtension.sol"; @@ -77,7 +77,7 @@ abstract contract MilestonesExtension is CoreBaseStrategy, IMilestonesExtension // Loop through the milestones and add them to the milestones array uint256 milestonesLength = _milestones.length; - for (uint256 i; i < milestonesLength;) { + for (uint256 i; i < milestonesLength; ++i) { uint256 amountPercentage = _milestones[i].amountPercentage; if (amountPercentage == 0) revert INVALID_MILESTONE(); @@ -85,10 +85,6 @@ abstract contract MilestonesExtension is CoreBaseStrategy, IMilestonesExtension totalAmountPercentage += amountPercentage; _milestones[i].status = MilestoneStatus.None; milestones.push(_milestones[i]); - - unchecked { - i++; - } } // Check if the all milestone amount percentage totals to 1e18 (100%) diff --git a/contracts/extensions/contracts/RecipientsExtension.sol b/contracts/extensions/contracts/RecipientsExtension.sol index 9263f8f46..f3d155485 100644 --- a/contracts/extensions/contracts/RecipientsExtension.sol +++ b/contracts/extensions/contracts/RecipientsExtension.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {IRecipientsExtension} from "../interfaces/IRecipientsExtension.sol"; import {IRegistry} from "../../core/interfaces/IRegistry.sol"; @@ -118,7 +118,7 @@ abstract contract RecipientsExtension is CoreBaseStrategy, Errors, IRecipientsEx _validateReviewRecipients(msg.sender); if (refRecipientsCounter != recipientsCounter) revert INVALID(); // Loop through the statuses and set the status - for (uint256 i; i < statuses.length;) { + for (uint256 i; i < statuses.length; ++i) { uint256 rowIndex = statuses[i].index; uint256 fullRow = statuses[i].statusRow; @@ -130,10 +130,6 @@ abstract contract RecipientsExtension is CoreBaseStrategy, Errors, IRecipientsEx // Emit that the recipient status has been updated with the values emit RecipientStatusUpdated(rowIndex, fullRow, msg.sender); - - unchecked { - i++; - } } } @@ -355,7 +351,7 @@ abstract contract RecipientsExtension is CoreBaseStrategy, Errors, IRecipientsEx function _processStatusRow(uint256 _rowIndex, uint256 _fullRow) internal returns (uint256) { // Loop through each status in the updated row uint256 currentRow = statusesBitMap[_rowIndex]; - for (uint256 col = 0; col < 64;) { + for (uint256 col = 0; col < 64; ++col) { // Extract the status at the column index uint256 colIndex = col << 2; // col * 4 uint8 newStatus = uint8((_fullRow >> colIndex) & 0xF); @@ -371,10 +367,6 @@ abstract contract RecipientsExtension is CoreBaseStrategy, Errors, IRecipientsEx _fullRow = reviewedRow | (uint256(reviewedStatus) << colIndex); } } - - unchecked { - col++; - } } return _fullRow; } diff --git a/contracts/extensions/interfaces/IMilestonesExtension.sol b/contracts/extensions/interfaces/IMilestonesExtension.sol index 8fd5a80ab..0c4368e08 100644 --- a/contracts/extensions/interfaces/IMilestonesExtension.sol +++ b/contracts/extensions/interfaces/IMilestonesExtension.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {Metadata} from "../../core/libraries/Metadata.sol"; diff --git a/contracts/extensions/interfaces/IRecipientsExtension.sol b/contracts/extensions/interfaces/IRecipientsExtension.sol index f925797e6..3723dadaa 100644 --- a/contracts/extensions/interfaces/IRecipientsExtension.sol +++ b/contracts/extensions/interfaces/IRecipientsExtension.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {Metadata} from "../../core/libraries/Metadata.sol"; diff --git a/contracts/factories/ContractFactory.sol b/contracts/factories/ContractFactory.sol index f7c911a76..e823db367 100644 --- a/contracts/factories/ContractFactory.sol +++ b/contracts/factories/ContractFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External import {CREATE3} from "solady/utils/CREATE3.sol"; diff --git a/contracts/factories/DGLFactory.sol b/contracts/factories/DGLFactory.sol index cdbfe3bac..ce8329874 100644 --- a/contracts/factories/DGLFactory.sol +++ b/contracts/factories/DGLFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import "solady/auth/Ownable.sol"; diff --git a/contracts/factories/DVMDTFactory.sol b/contracts/factories/DVMDTFactory.sol index 8d86cd7b7..ec3344d83 100644 --- a/contracts/factories/DVMDTFactory.sol +++ b/contracts/factories/DVMDTFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import "solady/auth/Ownable.sol"; diff --git a/contracts/migration/AlloV1ToV2ProfileMigration.sol b/contracts/migration/AlloV1ToV2ProfileMigration.sol index 4a360e5f3..c4d68b552 100644 --- a/contracts/migration/AlloV1ToV2ProfileMigration.sol +++ b/contracts/migration/AlloV1ToV2ProfileMigration.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Core Contracts import {Metadata} from "../core/libraries/Metadata.sol"; @@ -83,7 +83,7 @@ contract AlloV1ToV2ProfileMigration { bytes32[] memory migratedProfileIds = new bytes32[](_profilesLength); - for (uint256 i = 0; i < _profilesLength;) { + for (uint256 i = 0; i < _profilesLength; ++i) { bytes32 alloV1 = _projectIds[i]; uint256 alloV1ChainId = _sourceChainIds[i]; uint256 nonce = _nonces[i]; @@ -101,10 +101,6 @@ contract AlloV1ToV2ProfileMigration { alloV2ToAlloV1V2Profile[alloV2Profile] = alloV1V2Profile; emit ProfileMigrated(alloV1, alloV1ChainId, alloV2Profile, nonce); - - unchecked { - i++; - } } return abi.encode(migratedProfileIds); diff --git a/contracts/strategies/BaseStrategy.sol b/contracts/strategies/BaseStrategy.sol index c43fad456..c13deb351 100644 --- a/contracts/strategies/BaseStrategy.sol +++ b/contracts/strategies/BaseStrategy.sol @@ -217,11 +217,8 @@ abstract contract BaseStrategy is IStrategy, Errors { if (recipientLength != _data.length) revert ARRAY_MISMATCH(); PayoutSummary[] memory payouts = new PayoutSummary[](recipientLength); - for (uint256 i; i < recipientLength;) { + for (uint256 i; i < recipientLength; ++i) { payouts[i] = _getPayout(_recipientIds[i], _data[i]); - unchecked { - i++; - } } return payouts; } diff --git a/contracts/strategies/CoreBaseStrategy.sol b/contracts/strategies/CoreBaseStrategy.sol index 7c7dbdbbc..b9729688a 100644 --- a/contracts/strategies/CoreBaseStrategy.sol +++ b/contracts/strategies/CoreBaseStrategy.sol @@ -1,5 +1,5 @@ /// SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; /// Interfaces import "contracts/core/interfaces/IBaseStrategy.sol"; diff --git a/contracts/strategies/DirectAllocation.sol b/contracts/strategies/DirectAllocation.sol index 5139f3e10..526bf3284 100644 --- a/contracts/strategies/DirectAllocation.sol +++ b/contracts/strategies/DirectAllocation.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Core Contracts import {CoreBaseStrategy} from "contracts/strategies/CoreBaseStrategy.sol"; @@ -74,15 +74,12 @@ contract DirectAllocationStrategy is CoreBaseStrategy, Native, Errors { } uint256 _totalNativeAmount; - for (uint256 _i = 0; _i < _recipientsLength;) { + for (uint256 _i = 0; _i < _recipientsLength; ++_i) { /// Direct allocate the funds if (_tokens[_i] == NATIVE) _totalNativeAmount += _amounts[_i]; _tokens[_i].transferAmountFrom(_sender, _recipients[_i], _amounts[_i]); emit DirectAllocated(_recipients[_i], _amounts[_i], _tokens[_i], _sender); - unchecked { - ++_i; - } } if (msg.value < _totalNativeAmount) revert ETH_MISMATCH(); diff --git a/contracts/strategies/DonationVotingMerkleDistribution.sol b/contracts/strategies/DonationVotingMerkleDistribution.sol index 6fae05756..058f8d9b1 100644 --- a/contracts/strategies/DonationVotingMerkleDistribution.sol +++ b/contracts/strategies/DonationVotingMerkleDistribution.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {MerkleProof} from "openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol"; diff --git a/contracts/strategies/DonationVotingOffchain.sol b/contracts/strategies/DonationVotingOffchain.sol index 91185bfa2..77f1b3ddf 100644 --- a/contracts/strategies/DonationVotingOffchain.sol +++ b/contracts/strategies/DonationVotingOffchain.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Interfaces import {IAllo} from "contracts/core/interfaces/IAllo.sol"; diff --git a/contracts/strategies/DonationVotingOnchain.sol b/contracts/strategies/DonationVotingOnchain.sol index a626daa8a..9f9f8a9d3 100644 --- a/contracts/strategies/DonationVotingOnchain.sol +++ b/contracts/strategies/DonationVotingOnchain.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Interfaces import {IAllo} from "contracts/core/interfaces/IAllo.sol"; diff --git a/contracts/strategies/EasyRPGF.sol b/contracts/strategies/EasyRPGF.sol index 95e3eda89..cea198ec3 100644 --- a/contracts/strategies/EasyRPGF.sol +++ b/contracts/strategies/EasyRPGF.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Interfaces import {IAllo} from "contracts/core/interfaces/IAllo.sol"; @@ -75,7 +75,7 @@ contract EasyRPGF is CoreBaseStrategy { } IAllo.Pool memory pool = allo.getPool(poolId); - for (uint256 i; i < payoutLength;) { + for (uint256 i; i < payoutLength; ++i) { uint256 amount = amounts[i]; address recipientAddress = _recipientIds[i]; @@ -83,10 +83,6 @@ contract EasyRPGF is CoreBaseStrategy { pool.token.transferAmount(recipientAddress, amount); emit Distributed(recipientAddress, abi.encode(amount, _sender)); - - unchecked { - ++i; - } } } diff --git a/contracts/strategies/QVImpactStream.sol b/contracts/strategies/QVImpactStream.sol index 458a3d009..a25484673 100644 --- a/contracts/strategies/QVImpactStream.sol +++ b/contracts/strategies/QVImpactStream.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; @@ -86,12 +86,8 @@ contract QVImpactStream is QVSimple { /// @param _allocators The allocator address array function batchAddAllocator(address[] memory _allocators) external onlyPoolManager(msg.sender) { uint256 length = _allocators.length; - for (uint256 i = 0; i < length;) { + for (uint256 i = 0; i < length; ++i) { _addAllocator(_allocators[i]); - - unchecked { - ++i; - } } } @@ -100,12 +96,8 @@ contract QVImpactStream is QVSimple { /// @param _allocators The allocators address array function batchRemoveAllocator(address[] memory _allocators) external onlyPoolManager(msg.sender) { uint256 length = _allocators.length; - for (uint256 i = 0; i < length;) { + for (uint256 i = 0; i < length; ++i) { _removeAllocator(_allocators[i]); - - unchecked { - ++i; - } } } @@ -119,7 +111,7 @@ contract QVImpactStream is QVSimple { uint256 totalAmount; uint256 length = _payouts.length; - for (uint256 i = 0; i < length;) { + for (uint256 i = 0; i < length; ++i) { Payout memory payout = _payouts[i]; uint256 amount = payout.amount; address recipientId = payout.recipientId; @@ -130,9 +122,6 @@ contract QVImpactStream is QVSimple { payouts[recipientId] = amount; totalAmount += amount; - unchecked { - ++i; - } } if (totalAmount > poolAmount) revert PAYOUT_MORE_THAN_POOL_BALANCE(); @@ -154,7 +143,7 @@ contract QVImpactStream is QVSimple { address poolToken = pool.token; uint256 length = _recipientIds.length; - for (uint256 i = 0; i < length;) { + for (uint256 i = 0; i < length; ++i) { address recipientId = _recipientIds[i]; Recipient storage recipient = _recipients[recipientId]; @@ -170,10 +159,6 @@ contract QVImpactStream is QVSimple { bytes memory data = abi.encode(recipientAddress, amount, _sender); emit Distributed(recipientId, data); - - unchecked { - ++i; - } } } diff --git a/contracts/strategies/QVSimple.sol b/contracts/strategies/QVSimple.sol index 46150ecfd..b4f599b25 100644 --- a/contracts/strategies/QVSimple.sol +++ b/contracts/strategies/QVSimple.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Interfaces import {IAllo} from "contracts/core/interfaces/IAllo.sol"; @@ -171,7 +171,7 @@ contract QVSimple is CoreBaseStrategy, RecipientsExtension { IAllo.Pool memory pool = allo.getPool(poolId); - for (uint256 i; i < payouts.length;) { + for (uint256 i; i < payouts.length; ++i) { address recipientId = _recipientIds[i]; Recipient memory recipient = _recipients[recipientId]; @@ -186,9 +186,6 @@ contract QVSimple is CoreBaseStrategy, RecipientsExtension { paidOut[recipientId] = true; emit Distributed(recipientId, abi.encode(recipient.recipientAddress, amount, _sender)); - unchecked { - ++i; - } } } diff --git a/contracts/strategies/README.md b/contracts/strategies/README.md index 4316e53c2..4b16cd685 100644 --- a/contracts/strategies/README.md +++ b/contracts/strategies/README.md @@ -17,7 +17,7 @@ The `BaseStrategy` contract serves as a foundational building block within the A ## Smart Contract Overview * **License:** The `BaseStrategy` contract adheres to the AGPL-3.0-only License, promoting open-source usage with specific terms. -* **Solidity Version:** Developed using Solidity version 0.8.19, leveraging the latest Ethereum smart contract advancements. +* **Solidity Version:** Supports Solidity versions ^0.8.19, but developed using Solidity version 0.8.22, leveraging the latest Ethereum smart contract advancements. * **External Libraries:** Imports `Transfer` library from the Allo core for optimized token transfers. * **Interfaces:** Implements the `IStrategy` interface, facilitating interaction with external components. diff --git a/contracts/strategies/RFPSimple.sol b/contracts/strategies/RFPSimple.sol index a239ba29f..7422096cc 100644 --- a/contracts/strategies/RFPSimple.sol +++ b/contracts/strategies/RFPSimple.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Interfaces import {IAllo} from "contracts/core/interfaces/IAllo.sol"; diff --git a/contracts/strategies/_poc/direct-grants-simple/DirectGrantsSimpleStrategy.sol b/contracts/strategies/_poc/direct-grants-simple/DirectGrantsSimpleStrategy.sol index 7e153b961..566c4e8b5 100644 --- a/contracts/strategies/_poc/direct-grants-simple/DirectGrantsSimpleStrategy.sol +++ b/contracts/strategies/_poc/direct-grants-simple/DirectGrantsSimpleStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {ReentrancyGuard} from "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; diff --git a/contracts/strategies/_poc/direct-grants-simple/README.md b/contracts/strategies/_poc/direct-grants-simple/README.md index e272163c0..3e91327ac 100644 --- a/contracts/strategies/_poc/direct-grants-simple/README.md +++ b/contracts/strategies/_poc/direct-grants-simple/README.md @@ -61,7 +61,7 @@ sequenceDiagram ## Smart Contract Overview - **License:** The `DirectGrantsSimpleStrategy` contract operates under the AGPL-3.0-only License, fostering open-source usage under specific terms. -- **Solidity Version:** Developed using Solidity version 0.8.19, capitalizing on the latest Ethereum smart contract functionalities. +- **Solidity Version:** Developed using Solidity version 0.8.22, capitalizing on the latest Ethereum smart contract functionalities. - **External Libraries:** Utilizes the `ReentrancyGuard` library from the OpenZeppelin contracts to prevent reentrant attacks. - **Interfaces:** Inherits from the `BaseStrategy` contract, extending its functionalities for direct grant allocation strategies. - **Internal Libraries:** Imports the `Metadata` library from the Allo core for metadata management. diff --git a/contracts/strategies/_poc/donation-voting-custom-registry/DonationVotingCustomRegistryStrategy.sol b/contracts/strategies/_poc/donation-voting-custom-registry/DonationVotingCustomRegistryStrategy.sol index 225cf1a11..7d4d46d25 100644 --- a/contracts/strategies/_poc/donation-voting-custom-registry/DonationVotingCustomRegistryStrategy.sol +++ b/contracts/strategies/_poc/donation-voting-custom-registry/DonationVotingCustomRegistryStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Core Contracts import {DonationVotingStrategy} from "../donation-voting/DonationVotingStrategy.sol"; diff --git a/contracts/strategies/_poc/donation-voting-custom-registry/SimpleProjectRegistry.sol b/contracts/strategies/_poc/donation-voting-custom-registry/SimpleProjectRegistry.sol index b491c03ed..9374f1437 100644 --- a/contracts/strategies/_poc/donation-voting-custom-registry/SimpleProjectRegistry.sol +++ b/contracts/strategies/_poc/donation-voting-custom-registry/SimpleProjectRegistry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; /** * Simple Project Registry diff --git a/contracts/strategies/_poc/donation-voting/DonationVotingStrategy.sol b/contracts/strategies/_poc/donation-voting/DonationVotingStrategy.sol index 009ea0ef2..0c6afb978 100644 --- a/contracts/strategies/_poc/donation-voting/DonationVotingStrategy.sol +++ b/contracts/strategies/_poc/donation-voting/DonationVotingStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {ReentrancyGuard} from "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; diff --git a/contracts/strategies/_poc/hedgey/HedgeyRFPCommitteeStrategy.sol b/contracts/strategies/_poc/hedgey/HedgeyRFPCommitteeStrategy.sol index 393337ea4..4d4bc6f9c 100644 --- a/contracts/strategies/_poc/hedgey/HedgeyRFPCommitteeStrategy.sol +++ b/contracts/strategies/_poc/hedgey/HedgeyRFPCommitteeStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Core Contracts import {RFPCommitteeStrategy} from "../../rfp-committee/RFPCommitteeStrategy.sol"; diff --git a/contracts/strategies/_poc/micro-grants/MicroGrantsBaseStrategy.sol b/contracts/strategies/_poc/micro-grants/MicroGrantsBaseStrategy.sol index a0a597193..226cbc6b4 100644 --- a/contracts/strategies/_poc/micro-grants/MicroGrantsBaseStrategy.sol +++ b/contracts/strategies/_poc/micro-grants/MicroGrantsBaseStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {ReentrancyGuard} from "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; diff --git a/contracts/strategies/_poc/micro-grants/MicroGrantsGovStrategy.sol b/contracts/strategies/_poc/micro-grants/MicroGrantsGovStrategy.sol index ae30d95f8..2dbc71273 100644 --- a/contracts/strategies/_poc/micro-grants/MicroGrantsGovStrategy.sol +++ b/contracts/strategies/_poc/micro-grants/MicroGrantsGovStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Interfaces import {UniversalGov} from "./interfaces/UniversalGov.sol"; diff --git a/contracts/strategies/_poc/micro-grants/MicroGrantsHatsStrategy.sol b/contracts/strategies/_poc/micro-grants/MicroGrantsHatsStrategy.sol index 093c1612b..6841f0258 100644 --- a/contracts/strategies/_poc/micro-grants/MicroGrantsHatsStrategy.sol +++ b/contracts/strategies/_poc/micro-grants/MicroGrantsHatsStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {IHats} from "hats-protocol/Interfaces/IHats.sol"; diff --git a/contracts/strategies/_poc/micro-grants/MicroGrantsStrategy.sol b/contracts/strategies/_poc/micro-grants/MicroGrantsStrategy.sol index cf974677d..e97608733 100644 --- a/contracts/strategies/_poc/micro-grants/MicroGrantsStrategy.sol +++ b/contracts/strategies/_poc/micro-grants/MicroGrantsStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Internal Libraries import {MicroGrantsBaseStrategy} from "./MicroGrantsBaseStrategy.sol"; diff --git a/contracts/strategies/_poc/micro-grants/README.md b/contracts/strategies/_poc/micro-grants/README.md index 1f86e6b69..cf7d31de6 100644 --- a/contracts/strategies/_poc/micro-grants/README.md +++ b/contracts/strategies/_poc/micro-grants/README.md @@ -64,7 +64,7 @@ sequenceDiagram ## Smart Contract Overview - **License:** The `RFPSimpleStrategy` contract operates under the AGPL-3.0-only License, fostering open-source usage under specific terms. -- **Solidity Version:** Developed using Solidity version 0.8.19, capitalizing on the latest Ethereum smart contract functionalities. +- **Solidity Version:** Developed using Solidity version ^0.8.19, capitalizing on the latest Ethereum smart contract functionalities. - **External Libraries:** Utilizes the `ReentrancyGuard` library from the OpenZeppelin contracts to prevent reentrant attacks. - **Interfaces:** Imports interfaces from the Allo core and external libraries. - **Internal Libraries:** Imports the `Metadata` library from the Allo core for metadata management. diff --git a/contracts/strategies/_poc/micro-grants/interfaces/UniversalGov.sol b/contracts/strategies/_poc/micro-grants/interfaces/UniversalGov.sol index d14f14109..9299e454b 100644 --- a/contracts/strategies/_poc/micro-grants/interfaces/UniversalGov.sol +++ b/contracts/strategies/_poc/micro-grants/interfaces/UniversalGov.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; interface UniversalGov { function getPriorVotes(address _account, uint256 _blockNumber) external view returns (uint96); diff --git a/contracts/strategies/_poc/proportional-payout/ProportionalPayoutStrategy.sol b/contracts/strategies/_poc/proportional-payout/ProportionalPayoutStrategy.sol index 4ff6dc70a..15fec8ea5 100644 --- a/contracts/strategies/_poc/proportional-payout/ProportionalPayoutStrategy.sol +++ b/contracts/strategies/_poc/proportional-payout/ProportionalPayoutStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {ERC721} from "solady/tokens/ERC721.sol"; import {IAllo} from "./../../../core/interfaces/IAllo.sol"; diff --git a/contracts/strategies/_poc/qv-governance/QVGovernanceERC20Votes.sol b/contracts/strategies/_poc/qv-governance/QVGovernanceERC20Votes.sol index 3fd0d3b6e..0db00b572 100644 --- a/contracts/strategies/_poc/qv-governance/QVGovernanceERC20Votes.sol +++ b/contracts/strategies/_poc/qv-governance/QVGovernanceERC20Votes.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import "openzeppelin-contracts/contracts/governance/utils/IVotes.sol"; diff --git a/contracts/strategies/_poc/qv-hackathon/HackathonQVStrategy.sol b/contracts/strategies/_poc/qv-hackathon/HackathonQVStrategy.sol index e56ffae81..3ab8e115f 100644 --- a/contracts/strategies/_poc/qv-hackathon/HackathonQVStrategy.sol +++ b/contracts/strategies/_poc/qv-hackathon/HackathonQVStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {ERC721} from "solady/tokens/ERC721.sol"; diff --git a/contracts/strategies/_poc/qv-hackathon/SchemaResolver.sol b/contracts/strategies/_poc/qv-hackathon/SchemaResolver.sol index b65e10df3..e00021ad1 100644 --- a/contracts/strategies/_poc/qv-hackathon/SchemaResolver.sol +++ b/contracts/strategies/_poc/qv-hackathon/SchemaResolver.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Code sourced from: https://github.com/ethereum-attestation-service/eas-contracts/blob/b50148418ea930426084e5e0508159b590ee6202/contracts/resolver/SchemaResolver.sol // Changes made: diff --git a/contracts/strategies/_poc/qv-impact-stream/QVImpactStreamStrategy.sol b/contracts/strategies/_poc/qv-impact-stream/QVImpactStreamStrategy.sol index 2e17b0fe4..df71e69df 100644 --- a/contracts/strategies/_poc/qv-impact-stream/QVImpactStreamStrategy.sol +++ b/contracts/strategies/_poc/qv-impact-stream/QVImpactStreamStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {Multicall} from "openzeppelin-contracts/contracts/utils/Multicall.sol"; diff --git a/contracts/strategies/_poc/qv-impact-stream/README.md b/contracts/strategies/_poc/qv-impact-stream/README.md index a526c0190..cad663656 100644 --- a/contracts/strategies/_poc/qv-impact-stream/README.md +++ b/contracts/strategies/_poc/qv-impact-stream/README.md @@ -35,7 +35,7 @@ sequenceDiagram ## Contract Overview * **License:** The `QVSimpleStrategy` contract adheres to the AGPL-3.0-only License, promoting open-source usage with specific terms. -* **Solidity Version:** Developed using Solidity version 0.8.19, leveraging the latest Ethereum smart contract advancements. +* **Solidity Version:** Developed using Solidity version 0.8.22, leveraging the latest Ethereum smart contract advancements. * **Inheritance:** Inherits from the `QVBaseStrategy` contract, inheriting and expanding core strategy functionalities. ### InitializeParamsSimple diff --git a/contracts/strategies/_poc/qv-nft-tiered/QVNftTieredStrategy.sol b/contracts/strategies/_poc/qv-nft-tiered/QVNftTieredStrategy.sol index fa1f5289c..a17f543ee 100644 --- a/contracts/strategies/_poc/qv-nft-tiered/QVNftTieredStrategy.sol +++ b/contracts/strategies/_poc/qv-nft-tiered/QVNftTieredStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {ERC721} from "solady/tokens/ERC721.sol"; diff --git a/contracts/strategies/_poc/sablier-v2/LockupDynamicStrategy.sol b/contracts/strategies/_poc/sablier-v2/LockupDynamicStrategy.sol index f7932de1a..541bb7439 100644 --- a/contracts/strategies/_poc/sablier-v2/LockupDynamicStrategy.sol +++ b/contracts/strategies/_poc/sablier-v2/LockupDynamicStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/contracts/strategies/_poc/sablier-v2/LockupLinearStrategy.sol b/contracts/strategies/_poc/sablier-v2/LockupLinearStrategy.sol index d7ff1f767..ffeabd140 100644 --- a/contracts/strategies/_poc/sablier-v2/LockupLinearStrategy.sol +++ b/contracts/strategies/_poc/sablier-v2/LockupLinearStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/contracts/strategies/_poc/sqf-superfluid/RecipientSuperApp.sol b/contracts/strategies/_poc/sqf-superfluid/RecipientSuperApp.sol index e6ee94a6f..f9a204926 100644 --- a/contracts/strategies/_poc/sqf-superfluid/RecipientSuperApp.sol +++ b/contracts/strategies/_poc/sqf-superfluid/RecipientSuperApp.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import { ISuperfluid, diff --git a/contracts/strategies/_poc/sqf-superfluid/RecipientSuperAppFactory.sol b/contracts/strategies/_poc/sqf-superfluid/RecipientSuperAppFactory.sol index 96cc014bc..d387d9706 100644 --- a/contracts/strategies/_poc/sqf-superfluid/RecipientSuperAppFactory.sol +++ b/contracts/strategies/_poc/sqf-superfluid/RecipientSuperAppFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import { ISuperfluid, diff --git a/contracts/strategies/_poc/sqf-superfluid/SQFSuperFluidStrategy.sol b/contracts/strategies/_poc/sqf-superfluid/SQFSuperFluidStrategy.sol index 47cf309f1..30cf305e1 100644 --- a/contracts/strategies/_poc/sqf-superfluid/SQFSuperFluidStrategy.sol +++ b/contracts/strategies/_poc/sqf-superfluid/SQFSuperFluidStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {ReentrancyGuard} from "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; diff --git a/contracts/strategies/_poc/wrapped-voting-nftmint/NFT.sol b/contracts/strategies/_poc/wrapped-voting-nftmint/NFT.sol index 89641adb2..7552de05b 100644 --- a/contracts/strategies/_poc/wrapped-voting-nftmint/NFT.sol +++ b/contracts/strategies/_poc/wrapped-voting-nftmint/NFT.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {ERC721} from "solady/tokens/ERC721.sol"; import "openzeppelin-contracts/contracts/utils/Strings.sol"; diff --git a/contracts/strategies/_poc/wrapped-voting-nftmint/NFTFactory.sol b/contracts/strategies/_poc/wrapped-voting-nftmint/NFTFactory.sol index 42cf07028..ade4d28eb 100644 --- a/contracts/strategies/_poc/wrapped-voting-nftmint/NFTFactory.sol +++ b/contracts/strategies/_poc/wrapped-voting-nftmint/NFTFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import "./NFT.sol"; diff --git a/contracts/strategies/_poc/wrapped-voting-nftmint/WrappedVotingNftMintStrategy.sol b/contracts/strategies/_poc/wrapped-voting-nftmint/WrappedVotingNftMintStrategy.sol index f6f6d2ee0..b6696fb4d 100644 --- a/contracts/strategies/_poc/wrapped-voting-nftmint/WrappedVotingNftMintStrategy.sol +++ b/contracts/strategies/_poc/wrapped-voting-nftmint/WrappedVotingNftMintStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {ReentrancyGuard} from "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; diff --git a/contracts/strategies/direct-grants-lite/DirectGrantsLite.sol b/contracts/strategies/direct-grants-lite/DirectGrantsLite.sol index c75cdcac8..c3654732c 100644 --- a/contracts/strategies/direct-grants-lite/DirectGrantsLite.sol +++ b/contracts/strategies/direct-grants-lite/DirectGrantsLite.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {Multicall} from "openzeppelin-contracts/contracts/utils/Multicall.sol"; @@ -255,7 +255,7 @@ contract DirectGrantsLiteStrategy is Native, BaseStrategy, Multicall { if (refRecipientsCounter != recipientsCounter) revert INVALID(); // Loop through the statuses and set the status uint256 length = statuses.length; - for (uint256 i; i < length;) { + for (uint256 i; i < length; ++i) { uint256 rowIndex = statuses[i].index; uint256 fullRow = statuses[i].statusRow; @@ -263,10 +263,6 @@ contract DirectGrantsLiteStrategy is Native, BaseStrategy, Multicall { // Emit that the recipient status has been updated with the values emit RecipientStatusUpdated(rowIndex, fullRow, msg.sender); - - unchecked { - i++; - } } } @@ -445,7 +441,7 @@ contract DirectGrantsLiteStrategy is Native, BaseStrategy, Multicall { if (length == 0) revert INVALID(); // nothing to allocate - for (uint256 i = 0; i < length;) { + for (uint256 i = 0; i < length; ++i) { Allocation memory allocation = allocations[i]; address recipientId = allocation.recipientId; Recipient memory recipient = _getRecipient(recipientId); @@ -466,10 +462,6 @@ contract DirectGrantsLiteStrategy is Native, BaseStrategy, Multicall { token.transferAmountFrom(_sender, recipientAddress, amount); emit Allocated(recipientId, amount, token, _sender); - - unchecked { - ++i; - } } if (nativeAmount > 0) _sender.transferAmountNative(nativeAmount); diff --git a/contracts/strategies/direct-grants-lite/README.md b/contracts/strategies/direct-grants-lite/README.md index 797f4f688..1156d5a4a 100644 --- a/contracts/strategies/direct-grants-lite/README.md +++ b/contracts/strategies/direct-grants-lite/README.md @@ -46,7 +46,7 @@ sequenceDiagram ## Smart Contract Overview - **License:** The `DirectGrantsLiteStrategy` contract adheres to the AGPL-3.0-only License, promoting open-source usage with specific terms. -- **Solidity Version:** Developed using Solidity version 0.8.19, leveraging the latest Ethereum smart contract advancements. +- **Solidity Version:** Developed using Solidity version 0.8.22, leveraging the latest Ethereum smart contract advancements. - **External Libraries:** Utilizes the `Multicall` library from OpenZeppelin. - **Interfaces:** Interfaces with the `IAllo` and `IRegistry` components for external communication. - **Inheritance:** Inherits from the `Native`, `BaseStrategy` and `Multicall` contracts, inheriting and expanding core strategy functionalities. diff --git a/contracts/strategies/donation-voting-merkle-base/DonationVotingMerkleDistributionBaseStrategy.sol b/contracts/strategies/donation-voting-merkle-base/DonationVotingMerkleDistributionBaseStrategy.sol index 352543577..426a9bf95 100644 --- a/contracts/strategies/donation-voting-merkle-base/DonationVotingMerkleDistributionBaseStrategy.sol +++ b/contracts/strategies/donation-voting-merkle-base/DonationVotingMerkleDistributionBaseStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {ISignatureTransfer} from "permit2/ISignatureTransfer.sol"; @@ -322,11 +322,8 @@ abstract contract DonationVotingMerkleDistributionBaseStrategy is Native, BaseSt } // Loop through the allowed tokens and set them to true - for (uint256 i; i < allowedTokensLength;) { + for (uint256 i; i < allowedTokensLength; ++i) { allowedTokens[_initializeData.allowedTokens[i]] = true; - unchecked { - i++; - } } } @@ -374,7 +371,7 @@ abstract contract DonationVotingMerkleDistributionBaseStrategy is Native, BaseSt { if (refRecipientsCounter != recipientsCounter) revert INVALID(); // Loop through the statuses and set the status - for (uint256 i; i < statuses.length;) { + for (uint256 i; i < statuses.length; ++i) { uint256 rowIndex = statuses[i].index; uint256 fullRow = statuses[i].statusRow; @@ -382,10 +379,6 @@ abstract contract DonationVotingMerkleDistributionBaseStrategy is Native, BaseSt // Emit that the recipient status has been updated with the values emit RecipientStatusUpdated(rowIndex, fullRow, msg.sender); - - unchecked { - i++; - } } } @@ -663,11 +656,8 @@ abstract contract DonationVotingMerkleDistributionBaseStrategy is Native, BaseSt uint256 length = distributions.length; // Loop through the distributions and distribute the funds - for (uint256 i; i < length;) { + for (uint256 i; i < length; ++i) { _distributeSingle(distributions[i]); - unchecked { - i++; - } } // Emit that the batch payout was successful diff --git a/contracts/strategies/donation-voting-merkle-distribution-direct-transfer/DonationVotingMerkleDistributionDirectTransferStrategy.sol b/contracts/strategies/donation-voting-merkle-distribution-direct-transfer/DonationVotingMerkleDistributionDirectTransferStrategy.sol index 214dfc6fe..0695a8e15 100644 --- a/contracts/strategies/donation-voting-merkle-distribution-direct-transfer/DonationVotingMerkleDistributionDirectTransferStrategy.sol +++ b/contracts/strategies/donation-voting-merkle-distribution-direct-transfer/DonationVotingMerkleDistributionDirectTransferStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {ISignatureTransfer} from "permit2/ISignatureTransfer.sol"; import {DonationVotingMerkleDistributionBaseStrategy} from diff --git a/contracts/strategies/donation-voting-merkle-distribution-direct-transfer/README.md b/contracts/strategies/donation-voting-merkle-distribution-direct-transfer/README.md index ed1b01891..824e616e9 100644 --- a/contracts/strategies/donation-voting-merkle-distribution-direct-transfer/README.md +++ b/contracts/strategies/donation-voting-merkle-distribution-direct-transfer/README.md @@ -59,7 +59,7 @@ sequenceDiagram ## Smart Contract Overview * **License:** The `DonationVotingMerkleDistributionDirectTransferStrategy` contract adheres to the AGPL-3.0-only License, promoting open-source usage with specific terms. -* **Solidity Version:** Developed using Solidity version 0.8.19, leveraging the latest Ethereum smart contract advancements. +* **Solidity Version:** Developed using Solidity version 0.8.22, leveraging the latest Ethereum smart contract advancements. * **External Libraries:** Utilizes the `MerkleProof`, `ReentrancyGuard`, `Multicall` libraries from OpenZeppelin for enhanced security, efficiency, and reentrancy protection, `SafeTransferLib` from Solady and `ISignatureTransfer` from Uniswap permit2. * **Interfaces:** Interfaces with the `IAllo` and `IRegistry` components for external communication. * **Inheritance:** Inherits from the `BaseStrategy` contract, inheriting and expanding core strategy functionalities. diff --git a/contracts/strategies/donation-voting-merkle-distribution-vault/DonationVotingMerkleDistributionVaultStrategy.sol b/contracts/strategies/donation-voting-merkle-distribution-vault/DonationVotingMerkleDistributionVaultStrategy.sol index 40147f3a3..60e5aab7d 100644 --- a/contracts/strategies/donation-voting-merkle-distribution-vault/DonationVotingMerkleDistributionVaultStrategy.sol +++ b/contracts/strategies/donation-voting-merkle-distribution-vault/DonationVotingMerkleDistributionVaultStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {ISignatureTransfer} from "permit2/ISignatureTransfer.sol"; import {DonationVotingMerkleDistributionBaseStrategy} from @@ -78,7 +78,7 @@ contract DonationVotingMerkleDistributionVaultStrategy is uint256 claimsLength = _claims.length; // Loop through the claims - for (uint256 i; i < claimsLength;) { + for (uint256 i; i < claimsLength; ++i) { Claim memory singleClaim = _claims[i]; Recipient memory recipient = _recipients[singleClaim.recipientId]; uint256 amount = claims[singleClaim.recipientId][singleClaim.token]; @@ -100,9 +100,6 @@ contract DonationVotingMerkleDistributionVaultStrategy is // Emit that the tokens have been claimed and sent to the recipient emit Claimed(singleClaim.recipientId, recipient.recipientAddress, amount, token); - unchecked { - i++; - } } } diff --git a/contracts/strategies/donation-voting-merkle-distribution-vault/README.md b/contracts/strategies/donation-voting-merkle-distribution-vault/README.md index 7f9a74580..305878a60 100644 --- a/contracts/strategies/donation-voting-merkle-distribution-vault/README.md +++ b/contracts/strategies/donation-voting-merkle-distribution-vault/README.md @@ -62,7 +62,7 @@ sequenceDiagram ## Smart Contract Overview * **License:** The `DonationVotingMerkleDistributionVaultStrategy` contract adheres to the AGPL-3.0-only License, promoting open-source usage with specific terms. -* **Solidity Version:** Developed using Solidity version 0.8.19, leveraging the latest Ethereum smart contract advancements. +* **Solidity Version:** Developed using Solidity version 0.8.22, leveraging the latest Ethereum smart contract advancements. * **External Libraries:** Utilizes the `MerkleProof`, `ReentrancyGuard`, `Multicall` libraries from OpenZeppelin for enhanced security, efficiency, and reentrancy protection, `SafeTransferLib` from Solady and `ISignatureTransfer` from Uniswap permit2. * **Interfaces:** Interfaces with the `IAllo` and `IRegistry` components for external communication. * **Inheritance:** Inherits from the `BaseStrategy` contract, inheriting and expanding core strategy functionalities. diff --git a/contracts/strategies/easy-rpgf/EasyRPGFStrategy.sol b/contracts/strategies/easy-rpgf/EasyRPGFStrategy.sol index 02818d539..3cf91fd6e 100644 --- a/contracts/strategies/easy-rpgf/EasyRPGFStrategy.sol +++ b/contracts/strategies/easy-rpgf/EasyRPGFStrategy.sol @@ -51,16 +51,13 @@ contract EasyRPGFStrategy is BaseStrategy { } IAllo.Pool memory pool = allo.getPool(poolId); - for (uint256 i; i < payoutLength;) { + for (uint256 i; i < payoutLength; ++i) { uint256 amount = amounts[i]; address recipientAddress = _recipientIds[i]; poolAmount -= amount; pool.token.transferAmount(recipientAddress, amount); emit Distributed(recipientAddress, recipientAddress, amount, _sender); - unchecked { - ++i; - } } } diff --git a/contracts/strategies/qv-base/QVBaseStrategy.sol b/contracts/strategies/qv-base/QVBaseStrategy.sol index 1ba24b474..b10a48119 100644 --- a/contracts/strategies/qv-base/QVBaseStrategy.sol +++ b/contracts/strategies/qv-base/QVBaseStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Interfaces import {IAllo} from "../../core/interfaces/IAllo.sol"; @@ -285,7 +285,7 @@ abstract contract QVBaseStrategy is BaseStrategy { uint256 recipientLength = _recipientIds.length; if (recipientLength != _recipientStatuses.length) revert INVALID(); - for (uint256 i; i < recipientLength;) { + for (uint256 i; i < recipientLength; ++i) { Status recipientStatus = _recipientStatuses[i]; address recipientId = _recipientIds[i]; Recipient storage recipient = recipients[recipientId]; @@ -312,10 +312,6 @@ abstract contract QVBaseStrategy is BaseStrategy { } emit Reviewed(recipientId, applicationId, recipientStatus, msg.sender); - - unchecked { - ++i; - } } } @@ -496,7 +492,7 @@ abstract contract QVBaseStrategy is BaseStrategy { onlyAfterAllocation { uint256 payoutLength = _recipientIds.length; - for (uint256 i; i < payoutLength;) { + for (uint256 i; i < payoutLength; ++i) { address recipientId = _recipientIds[i]; Recipient storage recipient = recipients[recipientId]; @@ -513,9 +509,6 @@ abstract contract QVBaseStrategy is BaseStrategy { paidOut[recipientId] = true; emit Distributed(recipientId, recipient.recipientAddress, amount, _sender); - unchecked { - ++i; - } } if (!distributionStarted) { distributionStarted = true; diff --git a/contracts/strategies/qv-base/README.md b/contracts/strategies/qv-base/README.md index 521ae2b6e..648378dff 100644 --- a/contracts/strategies/qv-base/README.md +++ b/contracts/strategies/qv-base/README.md @@ -54,7 +54,7 @@ sequenceDiagram ## Smart Contract Overview * **License:** The `QVBaseStrategy` contract adheres to the AGPL-3.0-only License, promoting open-source usage with specific terms. -* **Solidity Version:** Developed using Solidity version 0.8.19, leveraging the latest Ethereum smart contract advancements. +* **Solidity Version:** Developed using Solidity version 0.8.22, leveraging the latest Ethereum smart contract advancements. * **Internal Libraries:** Utilizes the `Metadata` library. * **Interfaces:** Interfaces with the `IAllo` and `IRegistry` components for external communication. * **Inheritance:** Inherits from the `BaseStrategy` contract, inheriting and expanding core strategy functionalities. diff --git a/contracts/strategies/qv-simple/QVSimpleStrategy.sol b/contracts/strategies/qv-simple/QVSimpleStrategy.sol index 178e0b891..59ed965f7 100644 --- a/contracts/strategies/qv-simple/QVSimpleStrategy.sol +++ b/contracts/strategies/qv-simple/QVSimpleStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {Multicall} from "openzeppelin-contracts/contracts/utils/Multicall.sol"; diff --git a/contracts/strategies/qv-simple/README.md b/contracts/strategies/qv-simple/README.md index 0851cbadb..13802e0c9 100644 --- a/contracts/strategies/qv-simple/README.md +++ b/contracts/strategies/qv-simple/README.md @@ -27,7 +27,7 @@ The `QVSimpleStrategy` is a Solidity smart contract that extends the `QVBaseStra ## Contract Overview * **License:** The `QVSimpleStrategy` contract adheres to the AGPL-3.0-only License, promoting open-source usage with specific terms. -* **Solidity Version:** Developed using Solidity version 0.8.19, leveraging the latest Ethereum smart contract advancements. +* **Solidity Version:** Developed using Solidity version 0.8.22, leveraging the latest Ethereum smart contract advancements. * **Inheritance:** Inherits from the `QVBaseStrategy` contract, inheriting and expanding core strategy functionalities. ## Structs and Enums diff --git a/contracts/strategies/rfp-committee/README.md b/contracts/strategies/rfp-committee/README.md index 127689cc6..035174f56 100644 --- a/contracts/strategies/rfp-committee/README.md +++ b/contracts/strategies/rfp-committee/README.md @@ -48,7 +48,7 @@ sequenceDiagram ## Smart Contract Overview - **License:** The `RFPCommitteeStrategy` contract operates under the AGPL-3.0-only License. -- **Solidity Version:** Developed using Solidity version 0.8.19. +- **Solidity Version:** Developed using Solidity version 0.8.22. - **Inheritance:** Inherits functionality from the `RFPSimpleStrategy` contract. - **Events:** Introduces an additional event `Voted` to signal committee member votes. - **Storage Variables:** Adds new storage variables for voting and threshold management. diff --git a/contracts/strategies/rfp-committee/RFPCommitteeStrategy.sol b/contracts/strategies/rfp-committee/RFPCommitteeStrategy.sol index c2d79f82f..1131f9a07 100644 --- a/contracts/strategies/rfp-committee/RFPCommitteeStrategy.sol +++ b/contracts/strategies/rfp-committee/RFPCommitteeStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // Core Contracts import {RFPSimpleStrategy} from "../rfp-simple/RFPSimpleStrategy.sol"; diff --git a/contracts/strategies/rfp-simple/README.md b/contracts/strategies/rfp-simple/README.md index 2b01dbdba..eaaedea86 100644 --- a/contracts/strategies/rfp-simple/README.md +++ b/contracts/strategies/rfp-simple/README.md @@ -55,7 +55,7 @@ sequenceDiagram ## Smart Contract Overview - **License:** The `RFPSimpleStrategy` contract operates under the AGPL-3.0-only License, fostering open-source usage under specific terms. -- **Solidity Version:** Developed using Solidity version 0.8.19, capitalizing on the latest Ethereum smart contract functionalities. +- **Solidity Version:** Developed using Solidity version 0.8.22, capitalizing on the latest Ethereum smart contract functionalities. - **External Libraries:** Utilizes the `ReentrancyGuard` library from the OpenZeppelin contracts to prevent reentrant attacks. - **Interfaces:** Imports interfaces from the Allo core and external libraries. - **Internal Libraries:** Imports the `Metadata` library from the Allo core for metadata management. diff --git a/contracts/strategies/rfp-simple/RFPSimpleStrategy.sol b/contracts/strategies/rfp-simple/RFPSimpleStrategy.sol index 3e9be436f..a84499690 100644 --- a/contracts/strategies/rfp-simple/RFPSimpleStrategy.sol +++ b/contracts/strategies/rfp-simple/RFPSimpleStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; // External Libraries import {ReentrancyGuard} from "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; @@ -241,7 +241,7 @@ contract RFPSimpleStrategy is BaseStrategy, ReentrancyGuard { // Loop through the milestones and add them to the milestones array uint256 milestonesLength = _milestones.length; - for (uint256 i; i < milestonesLength;) { + for (uint256 i; i < milestonesLength; ++i) { uint256 amountPercentage = _milestones[i].amountPercentage; if (amountPercentage == 0) revert INVALID_MILESTONE(); @@ -249,10 +249,6 @@ contract RFPSimpleStrategy is BaseStrategy, ReentrancyGuard { totalAmountPercentage += amountPercentage; _milestones[i].milestoneStatus = Status.None; milestones.push(_milestones[i]); - - unchecked { - i++; - } } // Check if the all milestone amount percentage totals to 1e18(100%) diff --git a/era.hardhat.config.ts b/era.hardhat.config.ts index ccfa3888d..5a3977c5f 100644 --- a/era.hardhat.config.ts +++ b/era.hardhat.config.ts @@ -59,7 +59,7 @@ const abiExporter = [ */ const config: HardhatUserConfig = { solidity: { - version: "0.8.19", + version: "0.8.22", settings: { optimizer: { enabled: true, diff --git a/foundry.toml b/foundry.toml index 9f876126c..b625e95fb 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,6 +1,6 @@ # Default Profile [profile.default] -solc-version = "0.8.19" +solc-version = "0.8.22" optimizer = true optimizer-runs = 1_000 src = 'contracts' @@ -10,6 +10,18 @@ test = 'test/foundry' cache_path = 'cache_forge' remappings = [] +# Hedgey Profile +[profile.hedgey] +solc-version = "0.8.19" +optimizer = true +optimizer-runs = 1_000 +src = 'none' +out = 'out' +libs = ['node_modules', 'lib'] +test = 'test-0_8_19/foundry' +cache_path = 'cache_forge' +remappings = [] + # Gas reporting gas_reports = [ "ContractFactory", diff --git a/hardhat.config.ts b/hardhat.config.ts index 70ec1930e..0191d4bcc 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -142,7 +142,7 @@ const config: HardhatUserConfig = { apiSecret: DEFENDER_TEAM_API_SECRET_KEY, }, solidity: { - version: "0.8.19", + version: "0.8.22", settings: { optimizer: { enabled: true, diff --git a/package.json b/package.json index d717cadf2..86a712bd1 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,10 @@ "license": "MIT", "private": true, "scripts": { - "compile": "forge compile", - "build": "forge build", - "test": "forge test", - "fmt": "forge fmt contracts/**/*.sol && forge fmt test/**/*.sol", + "compile": "FOUNDRY_PROFILE=hedgey forge compile && forge compile", + "build": "FOUNDRY_PROFILE=hedgey forge build && forge build", + "test": "FOUNDRY_PROFILE=hedgey forge test && forge test", + "fmt": "forge fmt contracts/**/*.sol && forge fmt test/**/*.sol && forge fmt test-0_8_19/**/*.sol", "fork": "anvil --fork-url", "chain": "anvil --block-time 10", "snap": "forge snapshot --snap ./snapshots/snapshot.json", diff --git a/test/foundry/strategies/hedgey/HedgeyRFPCommitteeStrategy.t.sol b/test-0_8_19/foundry/strategies/hedgey/HedgeyRFPCommitteeStrategy.t.sol similarity index 94% rename from test/foundry/strategies/hedgey/HedgeyRFPCommitteeStrategy.t.sol rename to test-0_8_19/foundry/strategies/hedgey/HedgeyRFPCommitteeStrategy.t.sol index ccc11a198..e7044ddfd 100644 --- a/test/foundry/strategies/hedgey/HedgeyRFPCommitteeStrategy.t.sol +++ b/test-0_8_19/foundry/strategies/hedgey/HedgeyRFPCommitteeStrategy.t.sol @@ -3,19 +3,19 @@ pragma solidity ^0.8.19; import "forge-std/Test.sol"; // Interfaces -import {IStrategy} from "../../../../contracts/core/interfaces/IStrategy.sol"; +import {IStrategy} from "contracts/core/interfaces/IStrategy.sol"; // Core contracts -import {HedgeyRFPCommitteeStrategy} from "../../../../contracts/strategies/_poc/hedgey/HedgeyRFPCommitteeStrategy.sol"; -import {RFPSimpleStrategy} from "../../../../contracts/strategies/rfp-simple/RFPSimpleStrategy.sol"; +import {HedgeyRFPCommitteeStrategy} from "contracts/strategies/_poc/hedgey/HedgeyRFPCommitteeStrategy.sol"; +import {RFPSimpleStrategy} from "contracts/strategies/rfp-simple/RFPSimpleStrategy.sol"; // Internal libraries -import {Errors} from "../../../../contracts/core/libraries/Errors.sol"; -import {Metadata} from "../../../../contracts/core/libraries/Metadata.sol"; +import {Errors} from "contracts/core/libraries/Errors.sol"; +import {Metadata} from "contracts/core/libraries/Metadata.sol"; // Test libraries -import {AlloSetup} from "../../shared/AlloSetup.sol"; -import {RegistrySetupFull} from "../../shared/RegistrySetup.sol"; -import {EventSetup} from "../../shared/EventSetup.sol"; +import {AlloSetup} from "test/foundry/shared/AlloSetup.sol"; +import {RegistrySetupFull} from "test/foundry/shared/RegistrySetup.sol"; +import {EventSetup} from "test/foundry/shared/EventSetup.sol"; import {HedgeySetup} from "./HedgeySetup.sol"; -import {MockERC20} from "../../../utils/MockERC20.sol"; +import {MockERC20} from "test/utils/MockERC20.sol"; contract HedgeyRFPCommitteeStrategyTest is Test, RegistrySetupFull, AlloSetup, HedgeySetup, EventSetup, Errors { // Events diff --git a/test/foundry/strategies/hedgey/HedgeySetup.sol b/test-0_8_19/foundry/strategies/hedgey/HedgeySetup.sol similarity index 93% rename from test/foundry/strategies/hedgey/HedgeySetup.sol rename to test-0_8_19/foundry/strategies/hedgey/HedgeySetup.sol index 709191f61..dbcd9229d 100644 --- a/test/foundry/strategies/hedgey/HedgeySetup.sol +++ b/test-0_8_19/foundry/strategies/hedgey/HedgeySetup.sol @@ -6,7 +6,7 @@ import "forge-std/Test.sol"; // Core contracts import {TokenVestingPlans} from "hedgey-vesting/VestingPlans/TokenVestingPlans.sol"; import {BatchPlanner} from "hedgey-vesting/Periphery/BatchPlanner.sol"; -import {Accounts} from "../../shared/Accounts.sol"; +import {Accounts} from "test/foundry/shared/Accounts.sol"; contract HedgeySetup is Test, Accounts { TokenVestingPlans internal _vesting_; diff --git a/test/foundry/extensions/BaseGatingExtension.sol b/test/foundry/extensions/BaseGatingExtension.sol index 0e2a49742..e4db04f4b 100644 --- a/test/foundry/extensions/BaseGatingExtension.sol +++ b/test/foundry/extensions/BaseGatingExtension.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import "forge-std/Test.sol"; diff --git a/test/foundry/extensions/EASGatingExtension.t.sol b/test/foundry/extensions/EASGatingExtension.t.sol index e22216acd..67e3545ce 100644 --- a/test/foundry/extensions/EASGatingExtension.t.sol +++ b/test/foundry/extensions/EASGatingExtension.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import "forge-std/Test.sol"; diff --git a/test/foundry/extensions/NFTGatingExtension.t.sol b/test/foundry/extensions/NFTGatingExtension.t.sol index f258a2348..18a2775c9 100644 --- a/test/foundry/extensions/NFTGatingExtension.t.sol +++ b/test/foundry/extensions/NFTGatingExtension.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import "forge-std/Test.sol"; diff --git a/test/foundry/extensions/TokenGatingExtension.t.sol b/test/foundry/extensions/TokenGatingExtension.t.sol index e6b4374c2..63d4b8b5a 100644 --- a/test/foundry/extensions/TokenGatingExtension.t.sol +++ b/test/foundry/extensions/TokenGatingExtension.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import "forge-std/Test.sol"; diff --git a/test/foundry/integration/DonationVotingMerkleDistribution.t.sol b/test/foundry/integration/DonationVotingMerkleDistribution.t.sol index 9576077e4..c1107f01b 100644 --- a/test/foundry/integration/DonationVotingMerkleDistribution.t.sol +++ b/test/foundry/integration/DonationVotingMerkleDistribution.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {IAllo} from "contracts/core/interfaces/IAllo.sol"; import {Metadata} from "contracts/core/Registry.sol"; diff --git a/test/foundry/integration/DonationVotingOffchain.t.sol b/test/foundry/integration/DonationVotingOffchain.t.sol index c4f91c218..4ec7d2915 100644 --- a/test/foundry/integration/DonationVotingOffchain.t.sol +++ b/test/foundry/integration/DonationVotingOffchain.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {IAllo} from "contracts/core/interfaces/IAllo.sol"; import {Metadata} from "contracts/core/Registry.sol"; diff --git a/test/foundry/integration/DonationVotingOnchain.t.sol b/test/foundry/integration/DonationVotingOnchain.t.sol index f30c4f983..c565aec2d 100644 --- a/test/foundry/integration/DonationVotingOnchain.t.sol +++ b/test/foundry/integration/DonationVotingOnchain.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {IAllo} from "contracts/core/interfaces/IAllo.sol"; import {Metadata} from "contracts/core/Registry.sol"; diff --git a/test/foundry/integration/IBiconomyForwarder.sol b/test/foundry/integration/IBiconomyForwarder.sol index 1108cca2d..e0d19fe8e 100644 --- a/test/foundry/integration/IBiconomyForwarder.sol +++ b/test/foundry/integration/IBiconomyForwarder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; interface IBiconomyForwarder { struct ERC20ForwardRequest { diff --git a/test/foundry/integration/IOwnable.sol b/test/foundry/integration/IOwnable.sol index 94564d826..b8e705a2e 100644 --- a/test/foundry/integration/IOwnable.sol +++ b/test/foundry/integration/IOwnable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.19; interface IOwnable { function owner() external view returns (address); diff --git a/test/foundry/integration/ITransparentUpgradeableProxy.sol b/test/foundry/integration/ITransparentUpgradeableProxy.sol index 3c04d5579..fe46c5fb1 100644 --- a/test/foundry/integration/ITransparentUpgradeableProxy.sol +++ b/test/foundry/integration/ITransparentUpgradeableProxy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.19; interface ITransparentUpgradeableProxy { function admin() external view returns (address); diff --git a/test/foundry/integration/QVImpactStream.t.sol b/test/foundry/integration/QVImpactStream.t.sol index c95af9311..e76ee9691 100644 --- a/test/foundry/integration/QVImpactStream.t.sol +++ b/test/foundry/integration/QVImpactStream.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {Test} from "forge-std/Test.sol"; import {Allo} from "contracts/core/Allo.sol"; diff --git a/test/foundry/strategies/CoreBaseStrategy.t.sol b/test/foundry/strategies/CoreBaseStrategy.t.sol index a0f360601..ff688039d 100644 --- a/test/foundry/strategies/CoreBaseStrategy.t.sol +++ b/test/foundry/strategies/CoreBaseStrategy.t.sol @@ -1,4 +1,4 @@ -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import "forge-std/Test.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/test/foundry/strategies/DirectAllocation.t.sol b/test/foundry/strategies/DirectAllocation.t.sol index 0d5b03a50..ca59df2a2 100644 --- a/test/foundry/strategies/DirectAllocation.t.sol +++ b/test/foundry/strategies/DirectAllocation.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {Test} from "forge-std/Test.sol"; import {DirectAllocationStrategy} from "../../../contracts/strategies/DirectAllocation.sol"; diff --git a/test/foundry/strategies/QVImpactStream.t.sol b/test/foundry/strategies/QVImpactStream.t.sol index 291483952..b5caf4d7b 100644 --- a/test/foundry/strategies/QVImpactStream.t.sol +++ b/test/foundry/strategies/QVImpactStream.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/test/utils/GasHelpers.sol b/test/utils/GasHelpers.sol index 3855ed3a8..405269437 100644 --- a/test/utils/GasHelpers.sol +++ b/test/utils/GasHelpers.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import "forge-std/Test.sol"; diff --git a/test/utils/MockAllo.sol b/test/utils/MockAllo.sol index 5bae25480..bf9098700 100644 --- a/test/utils/MockAllo.sol +++ b/test/utils/MockAllo.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {Allo} from "../../contracts/core/Allo.sol"; diff --git a/test/utils/MockBaseStrategy.sol b/test/utils/MockBaseStrategy.sol index e10256a04..703e7a27d 100644 --- a/test/utils/MockBaseStrategy.sol +++ b/test/utils/MockBaseStrategy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import "../../contracts/strategies/CoreBaseStrategy.sol"; diff --git a/test/utils/MockGatingExtension.sol b/test/utils/MockGatingExtension.sol index 423e21f6a..83a5986b5 100644 --- a/test/utils/MockGatingExtension.sol +++ b/test/utils/MockGatingExtension.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {CoreBaseStrategy} from "../../contracts/strategies/CoreBaseStrategy.sol"; import {EASGatingExtension} from "../../contracts/extensions/EASGatingExtension.sol"; diff --git a/test/utils/MockPassportDecoder.sol b/test/utils/MockPassportDecoder.sol index f9f314b68..825e374f8 100644 --- a/test/utils/MockPassportDecoder.sol +++ b/test/utils/MockPassportDecoder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; contract MockPassportDecoder { struct Score { diff --git a/test/utils/MockStrategyMilestonesExtension.sol b/test/utils/MockStrategyMilestonesExtension.sol index dabd675fb..16a827277 100644 --- a/test/utils/MockStrategyMilestonesExtension.sol +++ b/test/utils/MockStrategyMilestonesExtension.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {CoreBaseStrategy} from "../../contracts/strategies/CoreBaseStrategy.sol"; import {MilestonesExtension} from "../../contracts/extensions/contracts/MilestonesExtension.sol"; diff --git a/test/utils/MockStrategyRecipientsExtension.sol b/test/utils/MockStrategyRecipientsExtension.sol index 9a3921e2c..cda83a416 100644 --- a/test/utils/MockStrategyRecipientsExtension.sol +++ b/test/utils/MockStrategyRecipientsExtension.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; import {CoreBaseStrategy} from "../../contracts/strategies/CoreBaseStrategy.sol"; import {RecipientsExtension} from "../../contracts/extensions/contracts/RecipientsExtension.sol"; diff --git a/test/utils/MockUniversalGov.sol b/test/utils/MockUniversalGov.sol index dc60f78e2..0809bfdbf 100644 --- a/test/utils/MockUniversalGov.sol +++ b/test/utils/MockUniversalGov.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.19; +pragma solidity ^0.8.19; contract MockUniversalGov { mapping(address => uint256) public gov;