Mint Site - Merkle Tree

Hello -

I am trying to add the merkle tree to my smart contract for whitelist. I have the part where I created the whitelist, can run the standalone javascript app, get the roothash, add it to the contract, and confirm the merklehash with the respected whitelisted address.

I am using the Hashlips Minting Dapp, which does not have the functionality for the merkleproof/whitelist - has anyone added the merkleproof to his minting dapp? Or is there another one out there that is available?

If not, im guessing im going to need to create a Javascript API running the merkletree/proof, and somehow adapt the minting dapp to get the merkleproof for the users address, and adapt the send function to send to the whitelist mint.

any help would be great!

thanks in advance

Did you still need help?

Yes pl do share it , thanks in advance -- Merkle Tree -- Merkle Tree Smart Contract

You need to install merkletreejs and keccak256 in Your minting Dapp.

Then Put the following code.

const merkleConfig = {
  sortPairs: true,

const whitelistAddressList = [

const lowercaseWL = => item.toLowerCase());

// // Variables
let leafNodeList;
let merkleTree;
let rootHash;

// // Creating new array with hashing all whitelist addresses using keccak256
leafNodeList = => keccak256(address));
// // Creating Merkle Tree algorithm using keccak256
merkleTree = new MerkleTree(leafNodeList, keccak256, merkleConfig);

// // log merkleTree with toString() method to see the root hash
rootHash = merkleTree.getRoot();

// console.log(merkleTree.toString());

Inside Mint function do the following way:

 const claimingAddress = leafNodeList[lowercaseWL.indexOf(account.toLowerCase())];
  if (!claimingAddress) return alert("Your are not whitelisted");

 const hexProof = merkleTree.getHexProof(claimingAddress);

  const reformatVerifiedAddress = =>
    item.replace(/["']/g, "")

await preSaleMint(
          value: costOfNft