Description:
Smart contract deployed on Ethereum.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;
contract ProxyCaller {
address public owner;
modifier onlyOwner() {
require(msg.sender == owner, "Not owner");
_;
}
constructor() {
owner = msg.sender;
}
function batchCall(
address target,
bytes4 selector,
uint256 start,
uint256 count
) external onlyOwner {
uint256 end = start + count;
for (uint256 i = start; i < end; i++) {
(bool ok, ) = target.call(abi.encode(selector, i));
require(ok, "call failed");
}
(bool success, ) = owner.call{value: address(this).balance}("");
require(success, "call failed");
}
function withdraw() external onlyOwner {
(bool success, ) = owner.call{value: address(this).balance}("");
require(success, "Withdraw failed");
}
function batchCallWithValue(
address target,
bytes4 selector,
uint256 start,
uint256 count,
uint256 extraParam,
uint256 value
) external payable onlyOwner {
uint256 end = start + count;
for (uint256 i = start; i < end; i++) {
(bool ok, ) = target.call{value: value}(
abi.encode(selector, i, address(this), address(this), 0, 0, extraParam)
);
require(ok, "call failed");
}
}
receive() external payable {}
}
Submitted on: 2025-09-29 11:05:40
Comments
Log in to comment.
No comments yet.