Fix: Update Solidity version pragma for files using global keyword
#1003
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: Update Solidity version pragma for files using
globalkeywordDescription
This PR fixes a Solidity version compatibility issue in type definition files that use the
globalkeyword.Problem
The
using ... for ... globalsyntax was introduced in Solidity 0.8.13, but several files insrc/types/declared compatibility with^0.8.0. While this compiles successfully with the currentsolc = "0.8.26"infoundry.toml, it creates a version mismatch that could cause compilation failures if someone tries to compile with Solidity versions 0.8.0 - 0.8.12.Error when compiling with 0.8.0 - 0.8.12:
Changes
Updated the Solidity version pragma from
^0.8.0to^0.8.13in the following files:src/types/PoolKey.solsrc/types/Currency.solsrc/types/Slot0.solsrc/types/BalanceDelta.solBefore:
After:
Files Changed
src/types/PoolKey.sol^0.8.0^0.8.13globalsrc/types/Currency.sol^0.8.0^0.8.13globalsrc/types/Slot0.sol^0.8.0^0.8.13globalsrc/types/BalanceDelta.sol^0.8.0^0.8.13globalTesting
forge testforge buildImpact
Solidity Feature Reference
The
using ... for ... globalsyntax requires Solidity ≥ 0.8.13:Checklist