Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
LibConformStringTest:testConformStringFuzz(string,uint256) (runs: 255, μ: 157458, ~: 39347)
LibParseCharIsMaskTest:testIsMaskPastEnd(uint256,uint256,uint256) (runs: 256, μ: 14404, ~: 16067)
LibParseCharIsMaskTest:testIsMaskReference(string,uint256,uint256) (runs: 248, μ: 8002, ~: 8047)
LibParseCharSkipMaskTest:testSkipMaskPastEnd(uint256,uint256,uint256) (runs: 256, μ: 14151, ~: 15971)
LibParseCharSkipMaskTest:testSkipMaskReference(string,uint256,uint256) (runs: 248, μ: 8192, ~: 8112)
TestLibParseDecimalUnsafeDecimalStringToInt:testUnsafeDecimalStrToIntEmpty(uint256,uint256) (runs: 256, μ: 4284, ~: 4096)
TestLibParseDecimalUnsafeDecimalStringToInt:testUnsafeDecimalStrToIntOverflowVeryLarge(uint256,uint256,uint8) (runs: 253, μ: 41972, ~: 35920)
TestLibParseDecimalUnsafeDecimalStringToInt:testUnsafeDecimalStrToIntRoundTrip(uint256,uint8) (runs: 256, μ: 29196, ~: 22423)
TestLibParseDecimalUnsafeDecimalStringToSignedInt:testUnsafeStrToSignedIntExamples() (gas: 49608)
TestLibParseDecimalUnsafeDecimalStringToSignedInt:testUnsafeStrToSignedIntOverflowNegative(uint256,uint8) (runs: 256, μ: 42659, ~: 33072)
TestLibParseDecimalUnsafeDecimalStringToSignedInt:testUnsafeStrToSignedIntOverflowPositive(uint256,uint8) (runs: 256, μ: 42661, ~: 33074)
TestLibParseDecimalUnsafeDecimalStringToSignedInt:testUnsafeStrToSignedIntRoundTrip(uint256,uint8,bool) (runs: 256, μ: 31559, ~: 25797)
LibConformStringTest:testConformStringFuzz(string,uint256) (runs: 255, μ: 151751, ~: 38658)
LibParseCharIsMaskTest:testIsMaskPastEnd(uint256,uint256,uint256) (runs: 256, μ: 13989, ~: 15797)
LibParseCharIsMaskTest:testIsMaskReference(string,uint256,uint256) (runs: 248, μ: 7891, ~: 7941)
LibParseCharSkipMaskTest:testSkipMaskPastEnd(uint256,uint256,uint256) (runs: 256, μ: 13990, ~: 15774)
LibParseCharSkipMaskTest:testSkipMaskReference(string,uint256,uint256) (runs: 248, μ: 8076, ~: 8004)
TestLibParseDecimalUnsafeDecimalStringToInt:testUnsafeDecimalStrToIntEmpty(uint256,uint256) (runs: 256, μ: 4162, ~: 3838)
TestLibParseDecimalUnsafeDecimalStringToInt:testUnsafeDecimalStrToIntOverflowVeryLarge(uint256,uint256,uint8) (runs: 253, μ: 40818, ~: 34560)
TestLibParseDecimalUnsafeDecimalStringToInt:testUnsafeDecimalStrToIntRoundTrip(uint256,uint8) (runs: 256, μ: 28814, ~: 22318)
TestLibParseDecimalUnsafeDecimalStringToSignedInt:testUnsafeStrToSignedIntExamples() (gas: 49315)
TestLibParseDecimalUnsafeDecimalStringToSignedInt:testUnsafeStrToSignedIntOverflowNegative(uint256,uint8) (runs: 256, μ: 40273, ~: 31512)
TestLibParseDecimalUnsafeDecimalStringToSignedInt:testUnsafeStrToSignedIntOverflowPositive(uint256,uint8) (runs: 256, μ: 40288, ~: 31527)
TestLibParseDecimalUnsafeDecimalStringToSignedInt:testUnsafeStrToSignedIntRoundTrip(uint256,uint8,bool) (runs: 256, μ: 30365, ~: 25176)
4 changes: 2 additions & 2 deletions foundry.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"lib/openzeppelin-contracts": {
"rev": "dc44c9f1a4c3b10af99492eed84f83ed244203f6"
"rev": "fcbae5394ae8ad52d8e580a3477db99814b9d565"
},
"lib/rain.solmem": {
"rev": "c1c22cf27963a9de0889ebf7f52869050f1fdfb9"
"rev": "f28da2f09d42d154783cb53c138a7ef2f3a9eb4a"
}
}
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
solc = "0.8.25"
optimizer = true
optimizer_runs = 100000
evm_version = "paris"
evm_version = "cancun"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check foundry.toml content and confirm the EVM version change
echo "=== foundry.toml content ==="
if [ -f "foundry.toml" ]; then
  cat -n foundry.toml
else
  echo "foundry.toml not found"
fi

echo -e "\n=== Searching for any Solidity version specifications ==="
rg -n "solidity|pragma" --type rust --type toml --type json -C 2 | head -50

echo -e "\n=== Checking for test or CI configuration that mentions EVM versions ==="
fd -e yml -e yaml -e json | xargs grep -l "evm\|cancun\|paris" 2>/dev/null | head -10

Repository: rainlanguage/rain.string

Length of output: 624


🏁 Script executed:

#!/bin/bash
# Check for any contracts that might have specific EVM version requirements
echo "=== Searching for EVM version mentions in Solidity files ==="
rg -n "pragma|evm|cancun" --type solidity -C 2 | head -100

echo -e "\n=== Looking for test files ==="
fd -e t.sol -e spec.sol -e test.sol | head -20

Repository: rainlanguage/rain.string

Length of output: 480


🏁 Script executed:

#!/bin/bash
# Check for any documentation or changelog related to EVM versions
echo "=== Searching for README or documentation ==="
fd -i readme | head -5

echo -e "\n=== Checking for CHANGELOG or release notes ==="
fd -i changelog | head -5

echo -e "\n=== Looking for OZ dependency mentions ==="
rg -n "openzeppelin|oz|5\.5\.0" -i | head -50

Repository: rainlanguage/rain.string

Length of output: 648


🏁 Script executed:

#!/bin/bash
# Check foundry.lock for OZ version and other dependencies
echo "=== foundry.lock content (first 50 lines) ==="
head -50 foundry.lock

echo -e "\n=== Searching for OpenZeppelin version specifically ==="
rg -A 5 '"openzeppelin-contracts"' foundry.lock

Repository: rainlanguage/rain.string

Length of output: 347


🏁 Script executed:

#!/bin/bash
# Check git history for the change and PR description
echo "=== Recent git log for foundry.toml ==="
git log --oneline -10 foundry.toml 2>/dev/null || echo "Git history not available"

echo -e "\n=== Git diff for foundry.toml ==="
git diff HEAD~1 foundry.toml 2>/dev/null || echo "Git diff not available"

echo -e "\n=== Current branch info ==="
git branch -v 2>/dev/null || echo "Git branch info not available"

echo -e "\n=== Last commit message ==="
git log -1 --format=%B 2>/dev/null || echo "Git log not available"

Repository: rainlanguage/rain.string

Length of output: 438


🏁 Script executed:

#!/bin/bash
# Check the actual Solidity contracts to see if they use any Cancun-specific features
echo "=== Looking at contract files ==="
fd -e sol --max-depth 3 | grep -v node_modules | grep -v test | head -10

echo -e "\n=== Reading a sample contract to check for any EVM-specific code ==="
fd -e sol --max-depth 3 | grep -v node_modules | grep -v test | head -1 | xargs cat 2>/dev/null | head -30

Repository: rainlanguage/rain.string

Length of output: 673


🌐 Web query:

Solidity 0.8.25 default EVM version Cancun

💡 Result:

Yes — Solidity v0.8.25 (released March 14, 2024) sets the compiler's default EVM version to "cancun". [1][2]

Sources:

  • Solidity 0.8.25 release announcement (Solidity blog). [1]
  • Solidity 0.8.25 release tag/changelog (GitHub). [2]

🌐 Web query:

Foundry EVM version cancun support

💡 Result:

Short answer: Yes — Foundry (forge/solc pipeline and anvil) supports the Cancun EVM. You can set evm_version = "cancun" in foundry.toml or pass --evm-version when running forge/forge tests. [1][2][3]

Notes:

  • Set in foundry.toml: evm_version = "cancun". [1][2]
  • Some Cancun features (e.g., transient storage) require Solidity >= 0.8.24 — make sure your solc_version matches the features you need. [3]

Sources:

  1. Foundry docs — EVM version configuration.
  2. getfoundry / community docs and examples using evm_version = "cancun".
  3. Uniswap / project docs calling out transients and recommending solc + evm_version = "cancun".

🌐 Web query:

OpenZeppelin Contracts 5.5.0 release Cancun EVM requirement

💡 Result:

Short answer: OpenZeppelin Contracts 5.x (including 5.5.0) uses Solidity >=0.8.20 (pragma ^0.8.20) which enables new opcodes introduced around the Cancun hard‑fork. That means builds compiled with a 0.8.20+ compiler using the compiler's default EVM (or evmVersion = "cancun") can emit opcodes (e.g., PUSH0 / other Cancun opcodes) that some chains and older verifiers do not support. So 5.5.0 does not strictly "require" evmVersion = cancun, but in practice you must compile with a compiler/EVM target compatible with your destination chain (or force an older evmVersion when supported) to avoid deployment/verification failures. [1][2]

References

  • OpenZeppelin Contracts repo (shows ^0.8.20 usage / documentation). [1]
  • Community/Forum reports and guidance about Cancun-opcode incompatibilities and choosing an older evmVersion for chains that don't support Cancun. [2]

🏁 Script executed:

#!/bin/bash
# Try to identify OZ version from commit hash
echo "=== Checking OZ commit hash fcbae5394ae8ad52d8e580a3477db99814b9d565 ==="
curl -s "https://api.github.com/repos/openzeppelin/openzeppelin-contracts/commits/fcbae5394ae8ad52d8e580a3477db99814b9d565" 2>/dev/null | grep -E '"message"|"tag_names"' | head -10 || echo "Could not fetch from GitHub API"

echo -e "\n=== Checking if OZ 5.5.0 release exists ==="
curl -s "https://api.github.com/repos/openzeppelin/openzeppelin-contracts/releases" 2>/dev/null | grep -i "5.5.0" | head -5 || echo "Could not fetch releases"

Repository: rainlanguage/rain.string

Length of output: 439


Update review comment: EVM version change to Cancun is reasonable, but clarify OZ 5.5.0 pragma expectations.

The change from paris to cancun is technically sound and aligns with best practices:

  • Solidity 0.8.25 defaults to Cancun as its EVM version
  • Foundry fully supports Cancun EVM configuration
  • OZ 5.5.0 uses pragma ^0.8.20 and emits Cancun-era opcodes (PUSH0, etc.), making Cancun the appropriate EVM target for this version

However, clarify in the PR description whether this change is required for OZ 5.5.0 compatibility or an intentional modernization. Also verify that your deployment targets (mainnet, testnets, etc.) support Cancun opcodes, as older chains may require reverting to an earlier EVM version to avoid verification failures.

🤖 Prompt for AI Agents
In foundry.toml around line 7, the PR changed evm_version to "cancun" but the
reviewer asks you to clarify whether this is required for OpenZeppelin 5.5.0
compatibility or just modernization and to verify target networks support Cancun
opcodes; update the PR description to state that OZ 5.5.0 uses pragma ^0.8.20
and emits Cancun-era opcodes so Cancun is recommended, and add a note that you
verified mainnet/testnets support Cancun (or document which chains require
reverting to an older evm_version) or implement per-network EVM settings if
needed to avoid verification failures.

2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts