Files
openzeppelin-contracts/contracts/mocks/BatchCaller.sol
Hadrien Croubois e30b390d84 Add ERC7674 (draft) (#5071)
Co-authored-by: Ernesto García <ernestognw@gmail.com>
Co-authored-by: cairo <cairoeth@protonmail.com>
2024-07-22 17:23:08 +02:00

21 lines
568 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {Address} from "../utils/Address.sol";
contract BatchCaller {
struct Call {
address target;
uint256 value;
bytes data;
}
function execute(Call[] calldata calls) external returns (bytes[] memory) {
bytes[] memory returndata = new bytes[](calls.length);
for (uint256 i = 0; i < calls.length; ++i) {
returndata[i] = Address.functionCallWithValue(calls[i].target, calls[i].data, calls[i].value);
}
return returndata;
}
}