Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ImanMousavi/596ae27372fbbc48d811d883a511d146 to your computer and use it in GitHub Desktop.

Select an option

Save ImanMousavi/596ae27372fbbc48d811d883a511d146 to your computer and use it in GitHub Desktop.
MultiSendETH.sol
pragma solidity ^0.8.20;
contract MultiSendETH {
function multiSendEqual(
address payable[] calldata _addresses,
uint256 _amountEther
) external payable {
require(_addresses.length > 0, "no addresses");
require(
_amountEther * _addresses.length <= msg.value,
"insufficient ETH"
);
for (uint256 i; i < _addresses.length; i++) {
_addresses[i].call{value: _amountEther}("");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment