🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

@mirror-protocol/mirror-airdrop

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
m

@mirror-protocol/mirror-airdrop

Airdrop implemation

1.0.3
77

Supply Chain Security

100

Vulnerability

90

Quality

83

Maintenance

100

License

Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Issues
2

Airdrop

How to use

Install package

$ npm install @mirror-protocol/mirror-airdrop

Create distribution list

airdrop.json

{
  "accounts": [
    {
      "address": "terra1qfqa2eu9wp272ha93lj4yhcenrc6ymng079nu8",
      "amount": "1000000"
    },
    {
      "address": "terra1ucp369yry6n70qq3zaxyt85cnug75r7ln8l6se",
      "amount": "2000000"
    },
    {
      "address": "terra1t849fxw7e8ney35mxemh4h3ayea4zf77dslwna",
      "amount": "3000000"
    },
    ...
  ]
}

Get proof with user input

import { Airdrop } from "@mirror-protocol/mirror-airdrop";
import { accounts } from "../airdrop.json";

const airdrop = new Airdrop(accounts);
const proof = airdrop.getMerkleProof(accounts[0]);

console.log("Merkle Root", airdrop.getMerkleRoot());
console.log("Merkle Proof", proof);
console.log("Target Acc", accounts[0]);
console.log("Verified", airdrop.verify(proof, accounts[0]));

Take snapshot

import { Snapshot } from "@mirror-protocol/mirror-airdrop";

const snapshot = new Snapsnot("https://lcd.terra.dev");
snapshot.takeSnapshot(10000).then(delegators => {
  console.log(delegators)
});

How to build contract

$ docker run --rm -v "$(pwd)":/code \
  --mount type=volume,source="devcontract_cache_airdrop",target=/code/contracts/airdrop/target \
  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
  cosmwasm/rust-optimizer:0.10.2 ./contracts/airdrop

FAQs

Package last updated on 26 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts