Airdropper Docs
  • 🥳AirDropper Intro
  • Getting Started
    • 📨Launch your first Airdrop
    • 📝FAQ
  • Features
    • 🚀Launcher
    • 🖥️Dashboard
    • 🪂Airdrop Listing
    • 🔗Embedded Button
    • 📊Data & Statistics
    • 🎁Sunday Airdrop
  • tokenomics
    • 🪙$AIR
    • 🚧$AIR on testnet
  • Contract governance
    • 📄Airdropper Contract
  • Developers
    • 🪳Bug Bounty
Powered by GitBook
On this page
  • Contract roles:
  • Owner
  • Variables
  • token - ERC20
  • dropAmount - uint256
  • dropCount - uint
  • active - bool
  • Public Functions
  • getAirdrop() - Public
  • getAddresses() - Public
  • tokenAmountLeft() - Public
  • Owner Functions
  • setDropAmount() - onlyDeployer or onlyOwner
  • enableAirdrop() - onlyDeployer or onlyOwner
  • disableAirdrop() - onlyDeployer or onlyOwner

Was this helpful?

  1. Contract governance

Airdropper Contract

Contract roles:

Role

Description

DEPLOYER_ROLE (onlyDeployer)

Deployer is the address used to deploy the airdrop contract with a specified ERC20 token

OWNER_ROLE (onlyOwner)

Deployer is the hot wallet address of airdropper.xyz

Owner

0xtodo

Hot wallet address controlled by airdropper.xyz multisignature contract

Variables

token - ERC20

ERC20 public token;

The ERC20 token linked to the contract in order to be dropped.

dropAmount - uint256

uint256 public dropAmount;

The total amount of tokens that can be claimed.

dropCount - uint

uint public dropCount;

The number of addresses that claimed the airdrop.

active - bool

bool public active;

Boolean that represents the state of the airdrop.

Public Functions

getAirdrop() - Public

    function getAirdrop() public {
        // requirements
        require(active, "Airdrop is not activated.");
        require(hasClaimed[msg.sender] == false, "Only one airdrop is authorized.");

        // Change contract stats
        hasClaimed[msg.sender] = true;
        dropCount += 1;
        droppedAddresses.push(msg.sender);

        // Get the airdrop
        token.transfer(msg.sender, dropAmount);
    }

Everyone can call this function to claim the airdrop and receive the specified amount of tokens.

  • The function is available only if the DEPLOYER_ROLE activated the airdrop.

  • You can only call it once with your address! Any futher attempts will result in a failed transaction.

getAddresses() - Public

    function getAddresses() public view returns (address[] memory){
        return droppedAddresses;
    }

Everyone can call this function to see who benefited from the airdrop.

tokenAmountLeft() - Public

    function tokenAmountLeft() public view returns (uint256){
        return token.balanceOf(address(this));
    }

Everyone can call this function to see the amount of tokens left in the contract.

Owner Functions

setDropAmount() - onlyDeployer or onlyOwner

function setDropAmount(uint256 _dropAmount){
    require(isAuthorized(msg.sender), "DOES_NOT_HAVE_PERMISSION");
    dropAmount = _dropAmount * 10 ** tokenDecimal;
}

enableAirdrop() - onlyDeployer or onlyOwner

function enableAirdrop() external{
    require(isAuthorized(msg.sender), "DOES_NOT_HAVE_PERMISSION");
    active = true;
}

disableAirdrop() - onlyDeployer or onlyOwner

function disableAirdrop() external{
    require(isAuthorized(msg.sender), "DOES_NOT_HAVE_PERMISSION");
    active = false;
}

Previous$AIR on testnetNextBug Bounty

Last updated 3 years ago

Was this helpful?

Note:

Only the DEPLOYER_ROLE or the OWNER_ROLE can call this function to disable the contract and the function.

Only the DEPLOYER_ROLE or the OWNER_ROLE can call this function to activate the contract and allow the function to work.

Only the DEPLOYER_ROLE or the OWNER_ROLE can call this function to disable the contract and the function.

📄
⚠️
getAirdrop()
getAirdrop()
getAirdrop()