Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MerkleProof rebuild root. #2840

Closed
Amxx opened this issue Aug 31, 2021 · 0 comments · Fixed by #2841
Closed

MerkleProof rebuild root. #2840

Amxx opened this issue Aug 31, 2021 · 0 comments · Fixed by #2841

Comments

@Amxx
Copy link
Collaborator

Amxx commented Aug 31, 2021

Sometimes it can be usefull to rebuild the root given a leaf and proof, but not check it matches a known value.

For example, one might have a mapping of valid roots mapping(bytes32 => bool) private _valid and may want to run

require(_valid[MerkleProof.getRoot(leaf, proof)], "proof doesn't match a valid merkle tree");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant