ProxyCaller

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 {}
}

Tags:
addr:0x6ff2214a7d2a97396a9e693240eb7e19d267e196|verified:true|block:23465277|tx:0x397217ec1c9d3549b551ba350a111d5e57a7387e6d6c1198d2979edd6f2ba194|first_check:1759136739

Submitted on: 2025-09-29 11:05:40

Comments

Log in to comment.

No comments yet.