BatchDelegator

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "BatchDelegator5.sol": {
      "content": "// SPDX-License-Identifier: MIT\r
pragma solidity ^0.8.19;\r
\r
/// @title 7702 Batch Delegator\r
/// @notice Under an EIP-7702 set-code tx, your EOA can adopt this code and forward batches of calls.\r
///         Sign an authorization for this contract’s address, then send a type-0x04 tx\r
///         to your EOA with data = abi.encodeWithSelector(BatchDelegator.executeBatch.selector, calls).\r
contract BatchDelegator {\r
    struct Call {\r
        address target;\r
        uint256 value;\r
        bytes   data;\r
    }\r
\r
    /// @param signer   The EOA that drove this execution (msg.sender once code is injected).\r
    /// @param calls    The batch of calls made.\r
    /// @param results  The returned data from each call.\r
    event BatchExecuted(\r
        address indexed signer,\r
        Call[]   calls,\r
        bytes[]  results\r
    );\r
\r
    /// @notice Forwards a batch of calls (and any ETH) atomically.\r
    /// @param calls  An array of { target, value, data } structs.\r
    ///                The sum of all value fields must be ≤ msg.value.\r
    /// @return results  An array of return data, one per call.\r
    function executeBatch(Call[] calldata calls)\r
        external\r
        payable\r
        returns (bytes[] memory results)\r
    {\r
        uint256 n = calls.length;\r
        results = new bytes[](n);\r
\r
        // Forward each call\r
        for (uint256 i = 0; i < n; i++) {\r
            Call calldata c = calls[i];\r
            (bool ok, bytes memory ret) = c.target.call{ value: c.value }(c.data);\r
            require(ok, "BatchDelegator: call failed");\r
\r
            require(ok, "BatchDelegator: call failed");\r
            results[i] = ret;\r
        }\r
\r
        emit BatchExecuted(msg.sender, calls, results);\r
        return results;\r
    }\r
}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": [],
    "evmVersion": "cancun"
  }
}}

Tags:
Factory|addr:0xdd1f24c945fd0744c6b0afaef36af46511db311f|verified:true|block:23677803|tx:0xd7e1714cd3beca3d598ebbd8d26c4153919d987785f3b663e46f1b6e842b4367|first_check:1761677673

Submitted on: 2025-10-28 19:54:34

Comments

Log in to comment.

No comments yet.