1.0.10 • Published 1 year ago

mint-site-merkle v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

mint-site-merkle

This is a marktree implementation for use on the mint site. Created to make addresses case-insensitive.

How to use

npm i mint-site-merkle

example

allowlist.js

export const types = ['address', 'uint248'];
export const lists = [
  ["0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", 5],
  ["0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2", 5],
  ["0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db", 5],
];

main.js

import { MintSiteMerkle } from "mint-site-merkle";
import { types, lists } from "./allowlist";

...

  const merkle = new MintSiteMerkle(types, lists);
  console.log(merkle.getRootHash());

...

  const list = merkle.findList(blockchain.account);
  if (merkle.verify(list)) {
    ...
    contract.methods.mint(amount, list[1], merkle.getHexProof(list)).send(...);
  }

important point

  • The first column of the list should be address
  • allowlist will be published externally
1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.0

1 year ago