Skip to content

Commit

Permalink
upd read.me
Browse files Browse the repository at this point in the history
  • Loading branch information
galekseev committed Mar 4, 2024
1 parent dc7475e commit 9cbd3e7
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,54 @@ Each next Merkle Tree root replaces previous one and should contain cumulative b
## Signature-based drop

Each entry of the drop contains private key which is used to sign the address of the receiver. This is done to safely distribute the drop and prevent MEV stealing.

## How to create qr-codes and deploy the contract
### Generation
To generate QR-codes for the drop, use the following command:
```bash
yarn qr:create <version> -a <token amounts> -n <qr-code numbers>
```
|Parameter|Description|
|---|---|
|version|Version of the drop. Used to identify the drop on the front-end side|
|token amounts|Comma-delimited list of amounts of tokens for each QR-code|
|qr-code numbers|Comma-delimited list of number of QR-codes to generate. The position corresponds to the position of amount|

Example:
To generate qr codes for the drop
|Amounts|Number of codes|
|---|---|
|5 INCH|100 qr-codes|
|10 INCH|50 qr-codes|
|20 INCH|20 qr-codes|

use the following command:

```bash
yarn qr:create 1 -a 5,10,20 -n 100,50,20
```

### Deployment
To deploy the contract, use the following command:

```bash
yarn qr:deploy hardhat --v <version> --r <merkle root> --h <merkle tree height>
```
|Parameter|Description|
|---|---|
|version|Version of the drop. Used to make deployment output JSON unique|
|merkle root|The root of the merkle tree. Should be taken from the previous step.|
|merkle tree height|The height of the merkle tree. Power of height |

Example:
For the drop generated in the previous example, use the following command:

```bash
yarn qr:deploy hardhat --v 36 --r 0x0ee0c05c1942ba534867e4676ddd0cc2 --h 8
```
where
|Parameter|Value|
|---|---|
|version|36|
|merkle root|0x0ee0c05c1942ba534867e4676ddd0cc2|
|merkle tree height|8|

0 comments on commit 9cbd3e7

Please sign in to comment.