Skip to content

Commit

Permalink
Add note about memory manipulation in MerkleTree (#5213)
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestognw committed Sep 19, 2024
1 parent 8a309ab commit b1f6bbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contracts/utils/structs/MerkleTree.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b1f6bbe

Please sign in to comment.