how to add address in the airdrop smart contract
how to add airdrop amount in smart contract ???
pls guide me
SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract AirdropContractTest {
event AirdropCoins(address indexed from, address[] to, uint256[] amount);
/**
* @dev Batch transfer ERC20 tokens to a list of recipients.
* @param token Address of the ERC20 contract.
* @param recipients List of addresses to transfer the tokens to.
* @param amount Amount of tokens to transfer to each recipient.
*/
function batchTransferERC20(
IERC20 token,
address[] calldata recipients,
uint256[] calldata amount
) external {
uint256 recipientsLength = recipients.length; // Cache the length of the recipients
// Sender must have enough tokens to send to recipients
require(recipientsLength== amount.length, "Each recipient needs tokens");
// Loop through all the recipients and send them the specified amount
for (uint256 i = 0; i < recipientsLength; i++) {
require(token.transfer(recipients[i], amount[i]));
}
emit AirdropCoins(msg.sender, recipients, amount);
}
}