From 824a295d1c4ce7191f47f0948f67b0b44b86afbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Garc=C3=ADa?= Date: Thu, 19 Sep 2024 09:08:52 -0600 Subject: [PATCH] Add note about memory manipulation in MerkleTree (#5213) Signed-off-by: Hadrien Croubois --- contracts/utils/structs/MerkleTree.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contracts/utils/structs/MerkleTree.sol b/contracts/utils/structs/MerkleTree.sol index c4933f79e..c3768ed8c 100644 --- a/contracts/utils/structs/MerkleTree.sol +++ b/contracts/utils/structs/MerkleTree.sol @@ -70,7 +70,10 @@ library MerkleTree { * should be pushed to it using the custom push function, which should be the same one as used during the setup. * * IMPORTANT: Providing a custom hashing function is a security-sensitive operation since it may - * compromise the soundness of the tree. Consider using functions from {Hashes}. + * compromise the soundness of the tree. + * + * NOTE: Consider verifying that the hashing function does not manipulate the memory state directly and that it + * follows the Solidity memory safety rules. Otherwise, it may lead to unexpected behavior. */ function setup( Bytes32PushTree storage self,