Update recommendation of JS library for merkle trees

(cherry picked from commit 8d105825e9)
release-v4.7
Francisco Giordano 2 years ago
parent 376cef91ca
commit 65dd47e8e2
  1. 10
      contracts/utils/cryptography/MerkleProof.sol

@ -6,16 +6,16 @@ pragma solidity ^0.8.0;
/** /**
* @dev These functions deal with verification of Merkle Tree proofs. * @dev These functions deal with verification of Merkle Tree proofs.
* *
* The proofs can be generated using the JavaScript library * The proofs can be generated using our JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs]. * https://github.com/OpenZeppelin/merkle-tree[`@openzeppelin/merkle-tree`].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * You will find a quickstart guide in the readme.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
* *
* WARNING: You should avoid using leaf values that are 64 bytes long prior to * WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves. * hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in * This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value. * the merkle tree could be reinterpreted as a leaf value.
* OpenZeppelin's JavaScript library generates merkle trees that are safe
* against this attack out of the box.
*/ */
library MerkleProof { library MerkleProof {
/** /**

Loading…
Cancel
Save