by YahyaOsi
This tool requires you to deploy a smart contract first. Follow these steps carefully.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/token/ERC20/IERC20.sol";
contract ERC20Multisender {
event TokensDispersed(address indexed token, uint256 totalAmount);
function disperseToken(
address tokenAddress,
address[] calldata recipients,
uint256[] calldata amounts
) external {
require(recipients.length == amounts.length, "Arrays must be equal length.");
require(recipients.length > 0, "Must have at least one recipient.");
IERC20 token = IERC20(tokenAddress);
uint256 totalAmount = 0;
for (uint i = 0; i < amounts.length; i++) {
totalAmount += amounts[i];
}
token.transferFrom(msg.sender, address(this), totalAmount);
for (uint i = 0; i < recipients.length; i++) {
token.transfer(recipients[i], amounts[i]);
}
emit TokensDispersed(tokenAddress, totalAmount);
}
}
Now that you have the contract address, you can use the tool below.
Connected Account:
Enter each recipient on a new line with the format: `address,amount`
Log messages will appear here...