Skip to content

Instantly share code, notes, and snippets.

@parv3213
Created June 12, 2024 12:48
Show Gist options
  • Save parv3213/9eadbb0a285326c79511a60069ea72aa to your computer and use it in GitHub Desktop.
Save parv3213/9eadbb0a285326c79511a60069ea72aa to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract BulkSender {
// This function sends specified amounts of ETH to multiple addresses.
function sendETH(address[] memory recipients, uint256 value) public payable {
// Send ETH to each recipient
for (uint256 i = 0; i < recipients.length; i++) {
(bool sent, ) = recipients[i].call{value: value}("");
require(sent, "Failed to send ETH");
}
}
// Fallback function to accept ETH sent to the contract
receive() external payable {}
}
@parv3213
Copy link
Author

Polygon: 0x963323B5e8913c19e1095548Cc0ad42dbFcE0089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment