Disperse

Git Source

Inherits: Ownable

Gas optimized bulk transfers of ERC20 and ETH that collects any given amount of fee in ETH.

Disclaimer: This is a forked and modified contract from PopPunkLLC/gaslite-core in order to collect fees. Original contract without fees can be found on: https://github.com/PopPunkLLC/gaslite-core/blob/d62de3c70fb53d5a315e2e33bfd61587abdd7212/src/GasliteDrop.sol

State Variables

collector

address public collector;

Functions

constructor

Initializes the contract with a collector address

constructor(address _collector) Ownable(msg.sender);

Parameters

NameTypeDescription
_collectoraddressThe address of the fee collector

setCollector

Sets the collector address

Only the contract owner can call this function

function setCollector(address _collector) external onlyOwner;

Parameters

NameTypeDescription
_collectoraddressThe address of the fee collector

airdropERC20

Airdrop ERC20 tokens to a list of addresses

function airdropERC20(
    address _token,
    address[] calldata _addresses,
    uint256[] calldata _amounts,
    uint256 _totalAmount
)
    external
    payable;

Parameters

NameTypeDescription
_tokenaddressThe address of the ERC20 contract
_addressesaddress[]The addresses to airdrop to
_amountsuint256[]The amounts to airdrop
_totalAmountuint256The total amount to airdrop

airdropETH

Airdrop ETH to a list of addresses

function airdropETH(address[] calldata _addresses, uint256[] calldata _amounts) external payable;

Parameters

NameTypeDescription
_addressesaddress[]The addresses to airdrop to
_amountsuint256[]The amounts to airdrop

collectFees

Sends any received Ether to the collector address.

function collectFees() public;

receive

Allows the contract to receive Ether directly with a call to this function.

Any Ether received is stored in the contract’s balance.

receive() external payable;