Skip to content

feat(solidity-import): support ECDSA Yul signature unpacking, StorageSlot raw string/bytes slots, and error scalar casts (slice 40) - #2501

Merged
Th0rgal merged 1 commit into
mainfrom
feat/solidity-import-slice-40
Oct 11, 2026
Merged

Th0rgal merged 1 commit into
mainfrom
feat/solidity-import-slice-40

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Oct 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Support Yul byte-buffer header and 32-byte word loads (mload(b) and mload(add(b, offset)) for offset >= 32 && offset % 32 == 0) on unshadowed bytes memory and string memory variables (yulByteBufferLoad? in Compiler/SolidityImport/Import.lean), enabling OpenZeppelin ECDSA.tryRecover(bytes32, bytes memory) signature unpacking.
  • Admit Yul assignments of provably-bounded expressions (isProvablyBoundedYulExpr: byte(i, x), comparisons, iszero, masked and, high shr, bounded mod, or bounded literals) to narrow non-enum scalar locals (such as uint8 v in v := byte(0, mload(add(signature, 0x60)))), while keeping arbitrary unmasked narrow-local Yul assignments rejected.
  • Accept scalar typeConversion casts in custom-error revert arguments (revert ECDSAInvalidSignatureLength(uint256(errorArg))).
  • Support raw bytes32 slot wrappers StorageSlot.getStringSlot(bytes32 slot) and StorageSlot.getBytesSlot(bytes32 slot) in inlineStorageStructFn.
  • Add Slice 40 end-to-end differential storage fixture (EcdsaMerkleCheckpointsStorageSlotSequence), rejection tests, and mutation killers.

…Slot raw string/bytes slots, and error scalar casts (slice 40)
@Th0rgal
Th0rgal merged commit 5fd3b74 into main Oct 11, 2026
@Th0rgal
Th0rgal deleted the feat/solidity-import-slice-40 branch October 11, 2026 16:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T16:34:12.289998Z 11ef669 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11ef669195

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2656 to +2658
return some {
pre := buf.pre,
expr := .mload (.add buf.pointer (.literal (off - 32)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Zero-pad the final materialized bytes word

When a root bytes memory parameter has a non-word-aligned length, this newly exposed mload can observe bytes past the declared payload. AbiLowering.bytesMemoryHead materializes each chunk with a full calldataload, so for a 33-byte value followed by nonzero trailing calldata, mload(add(b, 0x40)) returns those trailing bytes in the model; Solidity copies only the declared 33 bytes into memory and leaves the remaining 31 bytes zero. Mask/zero-pad the last copied word, or restrict this lowering to loads whose complete word is within the logical buffer.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant