/UmbriaAirdrop

Airdrop for early Umbria and Umbria-ETH LP holders

Primary LanguageSolidity

UmbriaAirdrop

Airdrop solidity contracts and migrations code, for early Umbria and Umbria-ETH LP holders.

This set of contracts and its respective migrations code is designed to be tested by the community, before deployment. This is for two reasons:

  • A) Transparency of operations - the community should know how the aidrop is being deployed
  • B) Auditing - maybe there is a mistake in the code that you can spot?

Getting started

I used Truffle, Ganache and VSCode for this deployment


Setting up truffle

npm install -g truffle
Creating a new truffle project
truffle init

After that, you can replace the contracts and migrations folders from this project into your project

Your truffle config should look something like this
module.exports = {
   networks: {
     test: {
       host: "127.0.0.1",
       port: 7545,
       network_id: 5777,
     },    
   },
   compilers: {
     solc: {
       version: "0.7.4",
       settings: {
         optimizer: {
           enabled: true,
           runs: 9999, // Optimize for how many times you intend to run the code
         },
       },
     },
   },
 };

Setting up Ganache

  • Open Ganache
  • Press the QUICKSTART button
  • Make sure the NETWORK ID and RPC SERVER values in the GUI match your truffle config
  • You can configure both NETWORK ID and RPC SERVER in the Ganache settings (Gear Icon)

Deploying the Airdrop Contracts, and Testing Their Functionality

The contract deployment occurs in two phases:

  1. 1_initial_migration.js runs first. This code does very little, it pretty much just records the time of deployment on the blockchain.
  2. 2_do_airdrop.js runs second. This code deploys the airdrop contract and all supporting contracts for executing the airdrop. Add your own deployments, tests etc to this deployment.

Expected Results

The airdrop contracts are expected to have the following functionality:
  • ✔️ msg.sender should be able to set a list of UMBR holders and their respective balances after March 1st
  • ✔️ msg.sender should be able to set a list of UMBR-ETH LP (Uniswap LP Token) holders and their respective balances after March 1st
  • ✔️ Anyone should be able to see their wallet's UMBR or UMBR-ETH LP balance at the time of the snapshot. If they had a balance of 0, the contract should throw an error
  • ✔️ The contract should store a mapping of users who have claimed the airdrop based on holding UMBR
  • ✔️ The contract should store a mapping of users who have claimed the airdrop based on holding UMBR-ETH LP
  • ✔️ The contract should throw an error if a user tries to double-claim
  • ✔️ The contract should store an amount of UMBR
  • ✔️ Airdrop amount should be contigent on UMBR/LP Balance vs Airdrop Max Supply
  • ✔️ The contract should allow users to claim using UMBR-ETH LP snapshot balance
  • ✔️ The contract should allow users to claim using UMBR snapshot balance
  • ✔️ The contract should emit an Airdrop even whenever a user claims