I have merkle proof integrated into our smart contract to implement a whitelist. It works nicely, but when I use a list of a lot of addresses (around 200), I run into issues. The proof for any address in this tree is an array of 8 hashes, and when putting that into the smart contract I keep getting 'false' as the result, even though I'm getting 'true' in my local environment. Am I not supposed to put in all 8 hashes for the proof or is there something else I'm missing? Thanks!
Hi @Adrian_Lawson
Can you share some of the code you're using and a way we could try to reproduce your issue?
I figured it out, I wasn't sorting the proofs that the tree was returning. I made this change in my javascript to fix it:
//before
const tree = new MerkleTree(leaves, keccak256)
//after
const tree = new MerkleTree(leaves, keccak256, {sortPairs: true})