From 4b3d7bef4d189e7d2c45594726940d00a6b0f5fe Mon Sep 17 00:00:00 2001 From: mfw78 Date: Tue, 4 Jun 2024 15:21:10 +0000 Subject: [PATCH 1/5] chore: bump pragma to support 0.8.x --- .vscode/settings.json | 1 - foundry.toml | 1 - src/contracts/GPv2AllowListAuthentication.sol | 2 +- src/contracts/GPv2Settlement.sol | 4 ++-- src/contracts/GPv2VaultRelayer.sol | 2 +- src/contracts/interfaces/GPv2Authentication.sol | 2 +- src/contracts/interfaces/GPv2EIP1271.sol | 2 +- src/contracts/interfaces/IERC20.sol | 2 +- src/contracts/interfaces/IVault.sol | 2 +- src/contracts/libraries/GPv2EIP1967.sol | 2 +- src/contracts/libraries/GPv2Interaction.sol | 2 +- src/contracts/libraries/GPv2Order.sol | 2 +- src/contracts/libraries/GPv2SafeERC20.sol | 2 +- src/contracts/libraries/GPv2Trade.sol | 2 +- src/contracts/libraries/GPv2Transfer.sol | 2 +- src/contracts/libraries/SafeCast.sol | 2 +- src/contracts/libraries/SafeMath.sol | 2 +- src/contracts/mixins/GPv2Signing.sol | 2 +- src/contracts/mixins/Initializable.sol | 2 +- src/contracts/mixins/ReentrancyGuard.sol | 2 +- src/contracts/mixins/StorageAccessible.sol | 2 +- src/contracts/reader/AllowListStorageReader.sol | 2 +- src/contracts/reader/GPv2TradeSimulator.sol | 2 +- src/contracts/reader/SettlementStorageReader.sol | 2 +- src/contracts/test/EventEmitter.sol | 2 +- .../test/GPv2AllowListAuthenticationTestInterface.sol | 2 +- src/contracts/test/GPv2AllowListAuthenticationV2.sol | 2 +- src/contracts/test/GPv2InteractionTestInterface.sol | 2 +- src/contracts/test/GPv2OrderTestInterface.sol | 2 +- src/contracts/test/GPv2SafeERC20TestInterface.sol | 2 +- src/contracts/test/GPv2SettlementTestInterface.sol | 2 +- src/contracts/test/GPv2SigningTestInterface.sol | 2 +- src/contracts/test/GPv2TradeTestInterface.sol | 2 +- src/contracts/test/GPv2TransferTestInterface.sol | 2 +- src/contracts/test/NonPayable.sol | 2 +- src/contracts/test/NonStandardERC20.sol | 2 +- src/contracts/test/SmartSellOrder.sol | 2 +- src/contracts/test/StateChangingERC1271.sol | 2 +- src/contracts/test/vendor/StorageAccessibleWrapper.sol | 2 +- test/TestNoOp.sol | 2 +- 40 files changed, 39 insertions(+), 41 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f0edb045..bdb69ebf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { - "solidity.packageDefaultDependenciesDirectory": ["node_modules", "lib"], "[solidity]": { "editor.defaultFormatter": "JuanBlanco.solidity" }, diff --git a/foundry.toml b/foundry.toml index 9cfdd148..39d90b86 100644 --- a/foundry.toml +++ b/foundry.toml @@ -4,7 +4,6 @@ out = "out" libs = ["node_modules", "lib"] # Compiler settings -solc = "0.7.6" via_ir = false optimizer = true optimizer_runs = 1000000 diff --git a/src/contracts/GPv2AllowListAuthentication.sol b/src/contracts/GPv2AllowListAuthentication.sol index 4758b457..47d593e6 100644 --- a/src/contracts/GPv2AllowListAuthentication.sol +++ b/src/contracts/GPv2AllowListAuthentication.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; import "./interfaces/GPv2Authentication.sol"; import "./libraries/GPv2EIP1967.sol"; diff --git a/src/contracts/GPv2Settlement.sol b/src/contracts/GPv2Settlement.sol index 4c95c56b..0820568e 100644 --- a/src/contracts/GPv2Settlement.sol +++ b/src/contracts/GPv2Settlement.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "./GPv2VaultRelayer.sol"; @@ -250,7 +250,7 @@ contract GPv2Settlement is GPv2Signing, ReentrancyGuard, StorageAccessible { function invalidateOrder(bytes calldata orderUid) external { (, address owner, ) = orderUid.extractOrderUidParams(); require(owner == msg.sender, "GPv2: caller does not own order"); - filledAmount[orderUid] = uint256(-1); + filledAmount[orderUid] = type(uint256).max; emit OrderInvalidated(owner, orderUid); } diff --git a/src/contracts/GPv2VaultRelayer.sol b/src/contracts/GPv2VaultRelayer.sol index a97d94a3..bcb12736 100644 --- a/src/contracts/GPv2VaultRelayer.sol +++ b/src/contracts/GPv2VaultRelayer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "./interfaces/IERC20.sol"; diff --git a/src/contracts/interfaces/GPv2Authentication.sol b/src/contracts/interfaces/GPv2Authentication.sol index 37ee0c7a..09e0c93a 100644 --- a/src/contracts/interfaces/GPv2Authentication.sol +++ b/src/contracts/interfaces/GPv2Authentication.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; /// @title Gnosis Protocol v2 Authentication Interface /// @author Gnosis Developers diff --git a/src/contracts/interfaces/GPv2EIP1271.sol b/src/contracts/interfaces/GPv2EIP1271.sol index 8ff92882..9b085392 100644 --- a/src/contracts/interfaces/GPv2EIP1271.sol +++ b/src/contracts/interfaces/GPv2EIP1271.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; library GPv2EIP1271 { /// @dev Value returned by a call to `isValidSignature` if the signature diff --git a/src/contracts/interfaces/IERC20.sol b/src/contracts/interfaces/IERC20.sol index 0481ff2f..38f85ff4 100644 --- a/src/contracts/interfaces/IERC20.sol +++ b/src/contracts/interfaces/IERC20.sol @@ -6,7 +6,7 @@ // - Added `name`, `symbol` and `decimals` function declarations // -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. diff --git a/src/contracts/interfaces/IVault.sol b/src/contracts/interfaces/IVault.sol index e0a8941a..38ef7a97 100644 --- a/src/contracts/interfaces/IVault.sol +++ b/src/contracts/interfaces/IVault.sol @@ -12,7 +12,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "./IERC20.sol"; diff --git a/src/contracts/libraries/GPv2EIP1967.sol b/src/contracts/libraries/GPv2EIP1967.sol index d74008d3..fab883ae 100644 --- a/src/contracts/libraries/GPv2EIP1967.sol +++ b/src/contracts/libraries/GPv2EIP1967.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; library GPv2EIP1967 { /// @dev The storage slot where the proxy administrator is stored, defined diff --git a/src/contracts/libraries/GPv2Interaction.sol b/src/contracts/libraries/GPv2Interaction.sol index 803bda67..49d0a736 100644 --- a/src/contracts/libraries/GPv2Interaction.sol +++ b/src/contracts/libraries/GPv2Interaction.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; /// @title Gnosis Protocol v2 Interaction Library /// @author Gnosis Developers diff --git a/src/contracts/libraries/GPv2Order.sol b/src/contracts/libraries/GPv2Order.sol index 0f608df8..e05c800a 100644 --- a/src/contracts/libraries/GPv2Order.sol +++ b/src/contracts/libraries/GPv2Order.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; import "../interfaces/IERC20.sol"; diff --git a/src/contracts/libraries/GPv2SafeERC20.sol b/src/contracts/libraries/GPv2SafeERC20.sol index 5b03d2e6..46cf8fb9 100644 --- a/src/contracts/libraries/GPv2SafeERC20.sol +++ b/src/contracts/libraries/GPv2SafeERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; import "../interfaces/IERC20.sol"; diff --git a/src/contracts/libraries/GPv2Trade.sol b/src/contracts/libraries/GPv2Trade.sol index 92b01e09..9a9a82fe 100644 --- a/src/contracts/libraries/GPv2Trade.sol +++ b/src/contracts/libraries/GPv2Trade.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; import "../interfaces/IERC20.sol"; import "../mixins/GPv2Signing.sol"; diff --git a/src/contracts/libraries/GPv2Transfer.sol b/src/contracts/libraries/GPv2Transfer.sol index a36568ba..be3314b7 100644 --- a/src/contracts/libraries/GPv2Transfer.sol +++ b/src/contracts/libraries/GPv2Transfer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "../interfaces/IERC20.sol"; diff --git a/src/contracts/libraries/SafeCast.sol b/src/contracts/libraries/SafeCast.sol index 14d0547e..4e4e038a 100644 --- a/src/contracts/libraries/SafeCast.sol +++ b/src/contracts/libraries/SafeCast.sol @@ -8,7 +8,7 @@ // - Convert to `type(*).*` notation // -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow diff --git a/src/contracts/libraries/SafeMath.sol b/src/contracts/libraries/SafeMath.sol index 638caa1e..dd056c18 100644 --- a/src/contracts/libraries/SafeMath.sol +++ b/src/contracts/libraries/SafeMath.sol @@ -8,7 +8,7 @@ // - Added `ceilDiv` method // -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow diff --git a/src/contracts/mixins/GPv2Signing.sol b/src/contracts/mixins/GPv2Signing.sol index 5363ca3b..16ac6502 100644 --- a/src/contracts/mixins/GPv2Signing.sol +++ b/src/contracts/mixins/GPv2Signing.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; import "../interfaces/GPv2EIP1271.sol"; import "../libraries/GPv2Order.sol"; diff --git a/src/contracts/mixins/Initializable.sol b/src/contracts/mixins/Initializable.sol index 51aa400a..f52d89d0 100644 --- a/src/contracts/mixins/Initializable.sol +++ b/src/contracts/mixins/Initializable.sol @@ -7,7 +7,7 @@ // - Inlined `Address.isContract` implementation // -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed diff --git a/src/contracts/mixins/ReentrancyGuard.sol b/src/contracts/mixins/ReentrancyGuard.sol index 0363b9d0..2c98d54b 100644 --- a/src/contracts/mixins/ReentrancyGuard.sol +++ b/src/contracts/mixins/ReentrancyGuard.sol @@ -5,7 +5,7 @@ // - Formatted code // -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; /** * @dev Contract module that helps prevent reentrant calls to a function. diff --git a/src/contracts/mixins/StorageAccessible.sol b/src/contracts/mixins/StorageAccessible.sol index 2dfa2974..a50f46c0 100644 --- a/src/contracts/mixins/StorageAccessible.sol +++ b/src/contracts/mixins/StorageAccessible.sol @@ -6,7 +6,7 @@ // - Added linter directives to ignore low level call and assembly warnings // -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; /// @title ViewStorageAccessible - Interface on top of StorageAccessible base class to allow simulations from view functions interface ViewStorageAccessible { diff --git a/src/contracts/reader/AllowListStorageReader.sol b/src/contracts/reader/AllowListStorageReader.sol index 7699f7a0..2c52146a 100644 --- a/src/contracts/reader/AllowListStorageReader.sol +++ b/src/contracts/reader/AllowListStorageReader.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; /// @title Gnosis Protocol v2 Allow List Storage Reader /// @author Gnosis Developers diff --git a/src/contracts/reader/GPv2TradeSimulator.sol b/src/contracts/reader/GPv2TradeSimulator.sol index 0cd77270..f99bf7ec 100644 --- a/src/contracts/reader/GPv2TradeSimulator.sol +++ b/src/contracts/reader/GPv2TradeSimulator.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "../GPv2Settlement.sol"; diff --git a/src/contracts/reader/SettlementStorageReader.sol b/src/contracts/reader/SettlementStorageReader.sol index 331fe208..b3582afc 100644 --- a/src/contracts/reader/SettlementStorageReader.sol +++ b/src/contracts/reader/SettlementStorageReader.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; /// @title Gnosis Protocol v2 Settlement Storage Reader diff --git a/src/contracts/test/EventEmitter.sol b/src/contracts/test/EventEmitter.sol index d061ddb3..b2802cff 100644 --- a/src/contracts/test/EventEmitter.sol +++ b/src/contracts/test/EventEmitter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; contract EventEmitter { event Event(uint256 value, uint256 number); diff --git a/src/contracts/test/GPv2AllowListAuthenticationTestInterface.sol b/src/contracts/test/GPv2AllowListAuthenticationTestInterface.sol index 1ffbe040..e8c91d6c 100644 --- a/src/contracts/test/GPv2AllowListAuthenticationTestInterface.sol +++ b/src/contracts/test/GPv2AllowListAuthenticationTestInterface.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; import "../GPv2AllowListAuthentication.sol"; import "../libraries/GPv2EIP1967.sol"; diff --git a/src/contracts/test/GPv2AllowListAuthenticationV2.sol b/src/contracts/test/GPv2AllowListAuthenticationV2.sol index aad8921a..17ea7aa8 100644 --- a/src/contracts/test/GPv2AllowListAuthenticationV2.sol +++ b/src/contracts/test/GPv2AllowListAuthenticationV2.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; import "../GPv2AllowListAuthentication.sol"; diff --git a/src/contracts/test/GPv2InteractionTestInterface.sol b/src/contracts/test/GPv2InteractionTestInterface.sol index d2d358a3..b7a63cff 100644 --- a/src/contracts/test/GPv2InteractionTestInterface.sol +++ b/src/contracts/test/GPv2InteractionTestInterface.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "../libraries/GPv2Interaction.sol"; diff --git a/src/contracts/test/GPv2OrderTestInterface.sol b/src/contracts/test/GPv2OrderTestInterface.sol index 735d3b6c..db39a4f7 100644 --- a/src/contracts/test/GPv2OrderTestInterface.sol +++ b/src/contracts/test/GPv2OrderTestInterface.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "../libraries/GPv2Order.sol"; diff --git a/src/contracts/test/GPv2SafeERC20TestInterface.sol b/src/contracts/test/GPv2SafeERC20TestInterface.sol index 61857d65..ee9f5c10 100644 --- a/src/contracts/test/GPv2SafeERC20TestInterface.sol +++ b/src/contracts/test/GPv2SafeERC20TestInterface.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "../interfaces/IERC20.sol"; diff --git a/src/contracts/test/GPv2SettlementTestInterface.sol b/src/contracts/test/GPv2SettlementTestInterface.sol index 0345bc45..c970c524 100644 --- a/src/contracts/test/GPv2SettlementTestInterface.sol +++ b/src/contracts/test/GPv2SettlementTestInterface.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "../GPv2Settlement.sol"; diff --git a/src/contracts/test/GPv2SigningTestInterface.sol b/src/contracts/test/GPv2SigningTestInterface.sol index 40e7e66e..556b8ea1 100644 --- a/src/contracts/test/GPv2SigningTestInterface.sol +++ b/src/contracts/test/GPv2SigningTestInterface.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "../libraries/GPv2Order.sol"; diff --git a/src/contracts/test/GPv2TradeTestInterface.sol b/src/contracts/test/GPv2TradeTestInterface.sol index 762c7de1..a92b4476 100644 --- a/src/contracts/test/GPv2TradeTestInterface.sol +++ b/src/contracts/test/GPv2TradeTestInterface.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "../libraries/GPv2Order.sol"; diff --git a/src/contracts/test/GPv2TransferTestInterface.sol b/src/contracts/test/GPv2TransferTestInterface.sol index c2eee5a7..7b079528 100644 --- a/src/contracts/test/GPv2TransferTestInterface.sol +++ b/src/contracts/test/GPv2TransferTestInterface.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "../libraries/GPv2Transfer.sol"; diff --git a/src/contracts/test/NonPayable.sol b/src/contracts/test/NonPayable.sol index 2b4cc02f..8c8194e9 100644 --- a/src/contracts/test/NonPayable.sol +++ b/src/contracts/test/NonPayable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; contract NonPayable { // solhint-disable-next-line no-empty-blocks, payable-fallback diff --git a/src/contracts/test/NonStandardERC20.sol b/src/contracts/test/NonStandardERC20.sol index 7adfba8b..a32ebb2a 100644 --- a/src/contracts/test/NonStandardERC20.sol +++ b/src/contracts/test/NonStandardERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; import "../libraries/SafeMath.sol"; diff --git a/src/contracts/test/SmartSellOrder.sol b/src/contracts/test/SmartSellOrder.sol index b2e01dc7..c050f183 100644 --- a/src/contracts/test/SmartSellOrder.sol +++ b/src/contracts/test/SmartSellOrder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; pragma abicoder v2; import "../interfaces/GPv2EIP1271.sol"; diff --git a/src/contracts/test/StateChangingERC1271.sol b/src/contracts/test/StateChangingERC1271.sol index aed8b663..12c3190f 100644 --- a/src/contracts/test/StateChangingERC1271.sol +++ b/src/contracts/test/StateChangingERC1271.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; import "../interfaces/GPv2EIP1271.sol"; diff --git a/src/contracts/test/vendor/StorageAccessibleWrapper.sol b/src/contracts/test/vendor/StorageAccessibleWrapper.sol index 8dcc3a8c..ed2c1313 100644 --- a/src/contracts/test/vendor/StorageAccessibleWrapper.sol +++ b/src/contracts/test/vendor/StorageAccessibleWrapper.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-only -pragma solidity >=0.7.0 <0.9.0; +pragma solidity >=0.7.6 <0.9.0; import "../../mixins/StorageAccessible.sol"; diff --git a/test/TestNoOp.sol b/test/TestNoOp.sol index a697cfc0..0145c843 100644 --- a/test/TestNoOp.sol +++ b/test/TestNoOp.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity ^0.7.6; +pragma solidity >=0.7.6 <0.9.0; /// @dev No-op contract for start of forgifying contracts. Delete this! contract TestNoOp { From ba6f47c6d5acce3b035595f14a0f85e8a40fb929 Mon Sep 17 00:00:00 2001 From: mfw78 Date: Tue, 4 Jun 2024 15:22:07 +0000 Subject: [PATCH 2/5] ci: run build tests for 0.7.6 and 0.8.26 --- .github/workflows/test.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bb0837f0..27642c18 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,6 +26,8 @@ jobs: test: strategy: fail-fast: true + matrix: + profile: [solc-0.7.6,solc-0.8.26] name: Foundry project runs-on: ubuntu-latest @@ -50,13 +52,18 @@ jobs: with: version: nightly - - name: Run Forge build - run: | - forge --version - forge build --sizes + - name: Run Forge build with ${{ matrix.profile }} + # We always build with 0.7.6 to ensure that the project is compatible with the oldest version + run: > + ( forge --version ) && + (( [ "${{ matrix.profile }}" == "solc-0.7.6" ] && + forge build --use 0.7.6 --sizes --skip 'test/*' ) || + ( [ "${{ matrix.profile }}" == "solc-0.8.26" ] && + forge build --use 0.8.26 --sizes )) id: build - name: Run Forge tests + if: matrix.profile == 'solc-0.8.26' run: | forge test -vvv id: test From b59788cbe331777f9d81f8145cffa5ad6389f4da Mon Sep 17 00:00:00 2001 From: mfw78 Date: Tue, 4 Jun 2024 15:24:02 +0000 Subject: [PATCH 3/5] fix: license --- test/TestNoOp.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/TestNoOp.sol b/test/TestNoOp.sol index 0145c843..8299b21b 100644 --- a/test/TestNoOp.sol +++ b/test/TestNoOp.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity >=0.7.6 <0.9.0; /// @dev No-op contract for start of forgifying contracts. Delete this! From 69328d2f45300d326e5f45455472982eeaeae2d4 Mon Sep 17 00:00:00 2001 From: mfw78 Date: Tue, 4 Jun 2024 15:38:10 +0000 Subject: [PATCH 4/5] ci: fix default strategy --- .github/workflows/test.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 27642c18..2995d796 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: true matrix: - profile: [solc-0.7.6,solc-0.8.26] + profile: [solc-0.7.6,default] name: Foundry project runs-on: ubuntu-latest @@ -58,12 +58,11 @@ jobs: ( forge --version ) && (( [ "${{ matrix.profile }}" == "solc-0.7.6" ] && forge build --use 0.7.6 --sizes --skip 'test/*' ) || - ( [ "${{ matrix.profile }}" == "solc-0.8.26" ] && - forge build --use 0.8.26 --sizes )) + ( forge build --sizes )) id: build - name: Run Forge tests - if: matrix.profile == 'solc-0.8.26' + if: matrix.profile != 'solc-0.7.6' run: | forge test -vvv id: test From 05bb6eb01589e0aae8f6d87997fadfec62ca5d48 Mon Sep 17 00:00:00 2001 From: mfw78 <53399572+mfw78@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:13:02 +0000 Subject: [PATCH 5/5] ci: neaten conditionality Co-authored-by: Federico Giacon <58218759+fedgiac@users.noreply.github.com> --- .github/workflows/test.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2995d796..5a6df9fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,11 +54,13 @@ jobs: - name: Run Forge build with ${{ matrix.profile }} # We always build with 0.7.6 to ensure that the project is compatible with the oldest version - run: > - ( forge --version ) && - (( [ "${{ matrix.profile }}" == "solc-0.7.6" ] && - forge build --use 0.7.6 --sizes --skip 'test/*' ) || - ( forge build --sizes )) + run: | + forge --version + if [ "${{ matrix.profile }}" == "solc-0.7.6" ]; then + forge build --sizes --use 0.7.6 --skip 'test/*' + else + forge build --sizes + fi id: build - name: Run Forge tests