Skip to main content

IAirdropERC20

Thirdweb's Airdrop contracts provide a lightweight and easy to use mechanism to drop tokens. AirdropERC20 contract is an airdrop contract for ERC20 tokens. It follows a push mechanism for transfer of tokens to intended recipients.

Methods​

addAirdropRecipients​

function addAirdropRecipients(IAirdropERC20.AirdropContent[] _contents) external payable

Parameters​

NameTypeDescription
_contentsIAirdropERC20.AirdropContent[]undefined

airdrop​

function airdrop(uint256 paymentsToProcess) external nonpayable

Lets contract-owner send ERC20 or native tokens to a list of addresses.

The token-owner should approve target tokens to Airdrop contract, which acts as operator for the tokens.

Parameters​

NameTypeDescription
paymentsToProcessuint256The number of airdrop payments to process.

getAllAirdropPayments​

function getAllAirdropPayments() external view returns (struct IAirdropERC20.AirdropContent[] contents)

Returns all airdrop payments set up -- pending, processed or failed.

Returns​

NameTypeDescription
contentsIAirdropERC20.AirdropContent[]undefined

getAllAirdropPaymentsFailed​

function getAllAirdropPaymentsFailed() external view returns (struct IAirdropERC20.AirdropContent[] contents)

Returns all pending airdrop failed.

Returns​

NameTypeDescription
contentsIAirdropERC20.AirdropContent[]undefined

getAllAirdropPaymentsPending​

function getAllAirdropPaymentsPending() external view returns (struct IAirdropERC20.AirdropContent[] contents)

Returns all pending airdrop payments.

Returns​

NameTypeDescription
contentsIAirdropERC20.AirdropContent[]undefined

getAllAirdropPaymentsProcessed​

function getAllAirdropPaymentsProcessed() external view returns (struct IAirdropERC20.AirdropContent[] contents)

Returns all pending airdrop processed.

Returns​

NameTypeDescription
contentsIAirdropERC20.AirdropContent[]undefined

Events​

AirdropPayment​

event AirdropPayment(address indexed recipient, IAirdropERC20.AirdropContent content)

Emitted when an airdrop payment is made to a recipient.

Parameters​

NameTypeDescription
recipient indexedaddressundefined
contentIAirdropERC20.AirdropContentundefined

RecipientsAdded​

event RecipientsAdded(IAirdropERC20.AirdropContent[] _contents)

Emitted when airdrop recipients are uploaded to the contract.

Parameters​

NameTypeDescription
_contentsIAirdropERC20.AirdropContent[]undefined