merklecreator
v1.0.3
Published
This script allows you to get merkle root and merkel proof
Downloads
5
Readme
RootMerkleCreator
This script allows you to get the hashRoot and the merkle proof for an array of given addresses. It uses the encrytage keccack256
How to use it?
Generate the hashRoot
- Import the function TreeRoot as
import {TreeRoot} from "merklecreator";
- Create an array of string. The space and others will be cleaned. Let's call it "whitelist"
- Launch the function with the previous array as
TreeRoot(whtitelist);
. Check the file exemple.js in case of doubt
Obtain the merkle proof of an address
Once the hash root is generated, never modify the array. Otherwise you'll have to generate a new hashRoot!!
- Import the function ClaimProof as
import {ClaimProof} from "merklecreator";
- Launch the function ClaimProof with the previous string array in parameter and the string requesting the proof as
claimProof("0x04...........3eFE7641a", whtitelist);
. Check the file exemple.js in case of doubt