Merkle-Airdrop

Introduction

The Merkle-Airdrop ADO is a smart contract that allows projects to launch airdrops using the Merkle-tree (hashing). Uses the same logic of the base cw20-merkel-airdrop contract. If you do not know what is a Merkle-airdrop and how it is different from a normal airdrop, please refer to the following article.

The merkle airdorp can be used to either airdrop CW20 tokens or native tokens.

In case of CW20 tokens, the airdrop ADO should be the owner of the CW20 tokens to distribute.

Ado_type: merkle-airdrop

Version: 2.0.1-beta.1

InstantiateMsg

pub struct InstantiateMsg {
    pub asset_info: Asset,
    pub kernel_address: String,
    pub owner: Option<String>
}

ExecuteMsg

RegisterMerkleRoot

Sets the provided Merkle-root that contains the whitelisted addresses that can claim tokens from the airdrop.

Only the owner can execute RegisterMerkleRoot.

 pub enum ExecuteMsg {
 RegisterMerkleRoot {
        merkle_root: String,
        expiration: Option<Expiry>,
        total_amount: Option<Uint128>,
  }
 }

Claim

Claims the funds assigned to the address executing the claim.

Only addresses found in the Merkle-Root can claim tokens.

 pub enum ExecuteMsg{  
   Claim {
        stage: u8,
        amount: Uint128,
        proof: Vec<String>,
    }
 }

Burn

Burn the remaining tokens (unclaimed) after expire time for the specified stage.

Only the owner can execute Burn.

 pub enum ExecuteMsg{
   Burn {
        stage: u8,
    }
}

Base Executes

The rest of the execute messages can be found in the ADO Base section.

Query

Config

pub enum QueryMsg {
 #[returns(ConfigResponse)]
 Config {}
 }

ConfigResponse

pub struct ConfigResponse {
    pub asset_info: Asset,
}

MerkleRoot

Queries the Merkle-Root for the specified stage.

pub enum QueryMsg {
 #[returns(MerkleRootResponse)]
 MerkleRoot {
  stage: u8
  }
}

MerkleRootResponse

pub struct MerkleRootResponse {
    pub stage: u8,
    pub merkle_root: String,
    pub expiration: Expiration,
    pub total_amount: Uint128,
}

LatestStage

Queries the last stage.

pub enum QueryMsg {
  #[returns(LatestStageResponse)]
  LatestStage {}
  }

LastStageResponse

pub struct LatestStageResponse {
    pub latest_stage: u8,
}

IsClaimed

Checks if the specified address has claimed the airdrop tokens.

pub enum QueryMsg {
    #[returns(IsClaimedResponse)]
    IsClaimed {
     stage: u8,
     address: String
      }
    }

IsClaimedResponse

pub struct IsClaimedResponse {
    pub is_claimed: bool,
}

TotalClaimed

pub enum QueryMsg {
  #[returns(TotalClaimedResponse)]
  TotalClaimed {
    stage: u8
    }
  }

TotalClaimedResponse

pub struct TotalClaimedResponse {
    pub total_claimed: Uint128,
}

Base Queries

The rest of the query messages can be found in the ADO Base section.

Additional Resources

GithubWebsite