# mint-site-merkle

> This is a merkle tree implementation for use on the mint site.

Latest version **1.0.10** (published 2023-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install mint-site-merkle
pnpm add mint-site-merkle
yarn add mint-site-merkle
bun add mint-site-merkle
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2023-03-20 |
| First published | 2023-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | hajime001 |
| Maintainers | hajme001 |
| Keywords | mint, merkle-tree |

## Links

- npm: https://www.npmjs.com/package/mint-site-merkle
- Repository: https://github.com/hajime001/mint-site-merkle
- Homepage: https://github.com/hajime001/mint-site-merkle#readme
- Issues: https://github.com/hajime001/mint-site-merkle/issues
- npm.io page: https://npm.io/package/mint-site-merkle

## Dependencies (5)

- [chai](https://npm.io/package/chai.md) ^4.3.7
- [mocha](https://npm.io/package/mocha.md) ^10.2.0
- [ethers](https://npm.io/package/ethers.md) ^5.7.0
- [keccak256](https://npm.io/package/keccak256.md) ^1.0.6
- [merkletreejs](https://npm.io/package/merkletreejs.md) ^0.3.9

## Recent versions

- 1.0.10 (latest) — 2023-03-20
- 1.0.9 — 2023-03-18
- 1.0.8 — 2023-03-18
- 1.0.7 — 2023-03-18
- 1.0.6 — 2023-03-18
- 1.0.5 — 2023-03-18
- 1.0.4 — 2023-03-16

## README

# 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

---
_Source: https://npm.io/package/mint-site-merkle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
