Coder Social home page Coder Social logo

cow-airdrop-contract-deployer's Introduction

Airdrop Contract Deployer

Use this project to deploy your ERC20 airdrop contracts. It follows the patttern interpreted by the CoW Aidrop Hooks dapp. To learn more about CoW Hooks, click here or take a look at the Swap with hooks page.

In order to deploy the contract and build the needed off-chain data of your airdrop, you will need to input a .csv file containing two columns: Address (the token receivers) and Airdrop (the amount of tokens of each one).

This contract uses the merkle proof system (see more about here) to check the claim legitimacy.

After following the steps below, you should have a folder containing the folder that the CoW frontend application will nedd to access to verify the users possible claims (see example here). If your wish is that your contract should appear in the CoW Airdrop Hooks application, you should make your folder available through a http request (possibly using github, for example).

Dependencies

  • yarn

Usage

1. Install modules

yarn install

2. Move your input .csv file with airdrop allocations to /input-folder and fill the .env with its name

An example .csv file can be seen here

The output should look like this plus a merkleRoot.json file

3. Process files. Convert the .csv into a folder containing the merkleProof, the chunks and the mapping.json file

yarn preprocess

4. Set up contract constructor variables in .env file:

  • set MERKLE_ROOT to the merkleRoot generated in /mock-airdrop-data/merkleRoot.json
  • set TOKEN_ADDRESS to the contract address in the network you want to deploy of the token to be used

5. Compile contract

npx hardhat compile

6. Deploy contract

  • Declare your network RPC URL and private key in the .env file
  • change /hardhat.config.ts to support the network you want to deploy
npx hardhat ignition deploy ignition/modules/MerkleDistributor.ts --deployment-id <id_of_your_choice>

The parameter <id_of_your_choice> is optional and you can use to make it easier to verify the contract later

7. Verify contract

Declare your Etherscan API key in the .env file

npx hardhat ignition verify <optional_id_of_your_choice>

Integrate with CoW Aidrop Hooks

If you want your airdrop to be claimable from CoW Airdrop Hooks, you can contact CoW community using Discord!

Just make sure you have the airdrop and token contract addresses for each network you deployed!

cow-airdrop-contract-deployer's People

Contributors

jeanneiverth avatar

Watchers

Pedro Yves Fracari avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.