Contract Source Code:
File 1 of 1 : Airdrop.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.21; interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); } contract Airdrop { function airdropApe(address payable[] calldata recipients, uint256[] calldata values) external payable { for (uint256 i = 0; i < recipients.length; i++) recipients[i].transfer(values[i]); uint256 balance = address(this).balance; if (balance > 0) payable(msg.sender).transfer(balance); } function airdropToken(IERC20 token, address[] calldata recipients, uint256[] calldata values) external { uint256 total = 0; for (uint256 i = 0; i < recipients.length; i++) total += values[i]; require(token.transferFrom(msg.sender, address(this), total)); for (uint256 i = 0; i < recipients.length; i++) require(token.transfer(recipients[i], values[i])); } function airdropTokenSimple(IERC20 token, address[] calldata recipients, uint256[] calldata values) external { for (uint256 i = 0; i < recipients.length; i++) require(token.transferFrom(msg.sender, recipients[i], values[i])); } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.