계정
0xfd...f501
0xfd...f501

0xfd...f501

$500
이 계약의 소스 코드가 검증되었습니다!
계약 메타데이터
컴파일러
0.8.22+commit.4fc1097e
언어
Solidity
계약 소스 코드
파일 1 / 1 : MultiRewardCall.sol
// 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;
            }
        }
    }
}
설정
{
  "compilationTarget": {
    "contracts/MultiRewardCall.sol": "MultiRewardCall"
  },
  "evmVersion": "paris",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": []
}
ABI
[{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct MultiRewardCall.Call[]","name":"calls","type":"tuple[]"}],"name":"claim","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"bytes[]","name":"returnData","type":"bytes[]"}],"stateMutability":"payable","type":"function"}]