Discover more of Apescan's tools and services in one place.
Contract Source Code:
File 1 of 1 : BatchTransfer
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; contract BatchTransfer { address public owner; constructor() payable { owner = msg.sender; } event BatchTransferExecuted(address indexed sender, uint256 amount, address[] recipients); modifier onlyOwner() { require(msg.sender == owner, "Only the owner can call this function"); _; } receive() external payable {} function deposit() external payable {} function withdrawAll() external onlyOwner { uint256 balance = address(this).balance; require(balance > 0, "Contract balance is zero"); payable(owner).transfer(balance); } function batchTransfer(address[] calldata recipients, uint256 amountPerRecipient) external onlyOwner { uint256 totalAmount = recipients.length * amountPerRecipient; require(address(this).balance >= totalAmount, "Insufficient contract balance"); for (uint256 i = 0; i < recipients.length; i++) { payable(recipients[i]).transfer(amountPerRecipient); } emit BatchTransferExecuted(msg.sender, amountPerRecipient, recipients); } function getBalance() external view returns (uint256) { return address(this).balance; } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.