Skip to content

Commit b1f6bbe

Browse files
authored
Add note about memory manipulation in MerkleTree (#5213)
1 parent 8a309ab commit b1f6bbe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

contracts/utils/structs/MerkleTree.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ library MerkleTree {
7070
* should be pushed to it using the custom push function, which should be the same one as used during the setup.
7171
*
7272
* IMPORTANT: Providing a custom hashing function is a security-sensitive operation since it may
73-
* compromise the soundness of the tree. Consider using functions from {Hashes}.
73+
* compromise the soundness of the tree.
74+
*
75+
* NOTE: Consider verifying that the hashing function does not manipulate the memory state directly and that it
76+
* follows the Solidity memory safety rules. Otherwise, it may lead to unexpected behavior.
7477
*/
7578
function setup(
7679
Bytes32PushTree storage self,

0 commit comments

Comments
 (0)