Memory-Safe Assembly
See original GitHub issue🧐 Motivation Solidity 0.8.13 marked the production readiness of the Yul IR pipeline. This, amongst other things, helps to alleviate stack too deep errors by allowing the compiler to move items to memory as and when needed.
📝 Details One requirement of the pipeline is that any assembly sections be memory-safe, such that they only use memory that has been previously allocated either by high-level Solidity code or by reading from the free memory pointer at 0x40.
Any memory-safe assembly can be marked as such by annotating it assembly ("memory-safe") { ... }
. However, this is only possible for code that uses 0.8.13 and above. For code that needs to be backward-compatible, the assembly block can be annotated:
/// @solidity memory-safe-assembly
assembly {
...
}
Details about what constitutes memory-safe code is available at https://docs.soliditylang.org/en/v0.8.13/assembly.html#memory-safety.
Would it be possible to review and annotate any uses of assembly within the OpenZeppelin libraries where it is determined to be memory-safe, and to modify then annotate when not?
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:14 (10 by maintainers)
Multiple PRs are okay but please try to minimize them. Feel free to continue to coordinate in this issue.
Hey @nathan-lapinski I have complete below files
contracts/utils/cryptography/ECDSA.sol, contracts/utils/cryptography/MerkleProof.sol, contracts/utils/Create2.sol.
Please update the status it’s merged