Skip to content

Remove Memory.asPointer and Memory.asBytes32 + add warning about setting the FMP to a low value#6348

Merged
Amxx merged 5 commits intomasterfrom
fix/memory/add-warning
Feb 12, 2026
Merged

Remove Memory.asPointer and Memory.asBytes32 + add warning about setting the FMP to a low value#6348
Amxx merged 5 commits intomasterfrom
fix/memory/add-warning

Conversation

@Amxx
Copy link
Collaborator

@Amxx Amxx commented Feb 11, 2026

Fixes 5.6 audit N.05

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

@Amxx Amxx added this to the 5.6 milestone Feb 11, 2026
@Amxx Amxx requested a review from a team as a code owner February 11, 2026 15:35
@openzeppelin-security-agent
Copy link

The latest updates on your security scan. Learn more about OpenZeppelin Platform.

Project Scan Issues Details Updated
Openzeppelin Contracts 🟡 Queued View Feb 11, 2026, 3:35 PM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2026

🦋 Changeset detected

Latest commit: 97c206e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Walkthrough

This pull request removes two helper functions from Memory.sol—asBytes32(Pointer) and asPointer(bytes32)—and updates all code that depends on them. The internal _nullPtr() function in Accumulators.sol is modified to use Memory.Pointer.wrap(0) directly. Test files are updated to replace calls to the removed functions with Memory.Pointer.wrap() and Memory.Pointer.unwrap() methods. Related test cases for the removed functions are deleted. A changeset entry documents a minor version bump for openzeppelin-solidity. An explanatory note is added to the setFreeMemoryPointer function's documentation.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: removing two functions (Memory.asPointer and Memory.asBytes32) and adding a warning about setting the FMP to a low value.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description directly references fixing audit item 5.6 (N.05) and describes the core changes: removing Memory.asPointer and Memory.asBytes32, and adding a warning about FMP configuration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/memory/add-warning

Comment @coderabbitai help to get the list of available commands and usage tips.

ernestognw
ernestognw previously approved these changes Feb 11, 2026
@Amxx Amxx merged commit a51494d into master Feb 12, 2026
23 checks passed
@Amxx Amxx deleted the fix/memory/add-warning branch February 12, 2026 10:32
Amxx added a commit that referenced this pull request Feb 12, 2026
…ing the FMP to a low value (#6348)

Co-authored-by: ernestognw <ernestognw@gmail.com>
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
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.

3 participants