24 lines
668 B
Solidity
24 lines
668 B
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.0;
|
|
|
|
interface IERC20 {
|
|
function transfer(address recipient, uint256 amount) external returns (bool);
|
|
}
|
|
|
|
contract MultiSendUSDT {
|
|
address public tokenAddress;
|
|
|
|
constructor(address _tokenAddress) {
|
|
tokenAddress = _tokenAddress;
|
|
}
|
|
|
|
function multiTransfer(address[] calldata to, uint256[] calldata amounts) external {
|
|
IERC20 token = IERC20(tokenAddress);
|
|
uint256 length = to.length;
|
|
require(length == amounts.length, "Arrays must have the same length");
|
|
|
|
for (uint256 i = 0; i < length; i++) {
|
|
token.transfer(to[i], amounts[i]);
|
|
}
|
|
}
|
|
} |