ETH Price: $2,078.95 (-1.13%)

Contract Diff Checker

Contract Name:
MultiRewardCall

Contract Source Code:

<i class='far fa-question-circle text-muted ms-2' data-bs-trigger='hover' data-bs-toggle='tooltip' data-bs-html='true' data-bs-title='Click on the check box to select individual contract to compare. Only 1 contract can be selected from each side.'></i>

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.20;

contract MultiRewardCall {
    struct Call {
        address target;
        bytes callData;
    }

    /// @notice Claim multiple rewards
    /// @param calls An array of Call structs
    /// @return blockNumber The block number where the calls were executed
    /// @return returnData An array of bytes containing the responses
    function claim(Call[] calldata calls) public payable returns (uint256 blockNumber, bytes[] memory returnData) {
        blockNumber = block.number;
        uint256 length = calls.length;
        returnData = new bytes[](length);
        Call calldata call;
        for (uint256 i = 0; i < length;) {
            bool success;
            call = calls[i];
            (success, returnData[i]) = call.target.call(call.callData);
            require(success, "MultiRewardCall: call failed");
            unchecked {
                ++i;
            }
        }
    }
}

Please enter a contract address above to load the contract details and source code.

Context size (optional):