// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
contract MultiFunctionContract {
struct CallData {
address contractAddress;
bytes callBytes;
}
event CallStatus(address indexed target, bool success);
modifier onlyOwner() {
require(
msg.sender == address(0x0000553F880fFA3728b290e04E819053A3590000),
"Caller is not an owner"
);
_;
}
function multicall(CallData[] memory calls) public onlyOwner {
for (uint256 i = 0; i < calls.length; i++) {
(bool success, ) = calls[i].contractAddress.call(
calls[i].callBytes
);
// require(success, "Fail");
emit CallStatus(calls[i].contractAddress, success);
}
}
}
{
"compilationTarget": {
"MultiFunctionContract.sol": "MultiFunctionContract"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"success","type":"bool"}],"name":"CallStatus","type":"event"},{"inputs":[{"components":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"bytes","name":"callBytes","type":"bytes"}],"internalType":"struct MultiFunctionContract.CallData[]","name":"calls","type":"tuple[]"}],"name":"multicall","outputs":[],"stateMutability":"nonpayable","type":"function"}]