• Home
  • Jobs
  • Courses
  • Questions
  • Teachers
  • For business
  • ES/EN

0

23
Views
merkletreejs method getHexProof return empty string

I'm trying to create a whitelist merkle tree for a NFT collection so I tried this code:

const { MerkleTree } = require('merkletreejs');
const keccak256 = require('keccak256');
const leaves = tab.map((address) => keccak256(address));
const tree = new MerkleTree(leaves, keccak256, { sort: true });
const root = tree.getHexRoot();
const leaf = keccak256('myaddress');
const proof = tree.getHexProof(leaf);

But proof is always empty, why?

PS: leaf look like that when I'm trying to log it: ���_�vD��CT,��sh��+o�j��ߧ

about 1 month ago ·

Juan Pablo Isaza

1 answers
Answer question

0

The proof was empty because my address ("myaddress" in the code) was not in the whitelist

about 1 month ago · Juan Pablo Isaza Report
Answer question
Find remote jobs
Loading

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2022 PeakU Inc. All Rights Reserved.