creation_sourcecode: // SPDX-License-Identifier: MIT
  
  pragma solidity ^0.8.4;
  
  interface IERC20 {
  
      event Transfer(address indexed from, address indexed to, uint256 value);
  
      event Approval(address indexed owner, address indexed spender, uint256 value);
  
      function totalSupply() external view returns (uint256);
  
      function balanceOf(address account) external view returns (uint256);
  
      function transfer(address to, uint256 amount) external returns (bool);
  
      function allowance(address owner, address spender) external view returns (uint256);
  
      function approve(address spender, uint256 amount) external returns (bool);
  
      function transferFrom(
          address from,
          address to,
          uint256 amount
      ) external returns (bool);
  }
  
  pragma solidity ^0.8.4;
  
  contract MultiTransfer {
  
      function multiTransferTokenFixedAmounts(
          address _token,
          address[] calldata _addresses,
          uint256 _amounts
          ) external {
          IERC20 token = IERC20(_token);
          uint _amountSum = _addresses.length*_amounts;
          require(token.allowance(msg.sender, address(this)) > _amountSum, "Need Approve ERC20 token");
          
          for (uint256 i; i < _addresses.length; i++) {
              token.transferFrom(msg.sender, _addresses[i], _amounts);
          }
      }
  
      function multiTransferETHFixedAmounts(
          address payable[] calldata _addresses,
          uint256  _amounts
      ) public payable {
          uint _amountSum = _addresses.length*_amounts;
          require(msg.value == _amountSum, "Transfer amount error");
          for (uint256 i = 0; i < _addresses.length; i++) {
              _addresses[i].transfer(_amounts);
          }
      }
  
      function multiTransferToken(
          address _token,
          address[] calldata _addresses,
          uint256[] calldata _amounts
          ) external {
          require(_addresses.length == _amounts.length, "Lengths of Addresses and Amounts NOT EQUAL");
          IERC20 token = IERC20(_token);
          uint _amountSum = getSum(_amounts);
          require(token.allowance(msg.sender, address(this)) > _amountSum, "Need Approve ERC20 token");
          
          for (uint256 i; i < _addresses.length; i++) {
              token.transferFrom(msg.sender, _addresses[i], _amounts[i]);
          }
      }
  
      function multiTransferETH(
          address payable[] calldata _addresses,
          uint256[] calldata _amounts
      ) public payable {
          require(_addresses.length == _amounts.length, "Lengths of Addresses and Amounts NOT EQUAL");
          uint _amountSum = getSum(_amounts);
          require(msg.value == _amountSum, "Transfer amount error");
          for (uint256 i = 0; i < _addresses.length; i++) {
              _addresses[i].transfer(_amounts[i]);
          }
      }
  
      function getSum(uint256[] calldata _arr) public pure returns(uint sum)
      {
          for(uint i = 0; i < _arr.length; i++)
              sum = sum + _arr[i];
      }
  }