You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
737 B
24 lines
737 B
4 years ago
|
// SPDX-License-Identifier: MIT
|
||
|
|
||
2 years ago
|
pragma solidity ^0.8.20;
|
||
4 years ago
|
|
||
2 years ago
|
import {ERC20MulticallMock} from "./token/ERC20MulticallMock.sol";
|
||
4 years ago
|
|
||
1 year ago
|
contract MulticallHelper {
|
||
2 years ago
|
function checkReturnValues(
|
||
2 years ago
|
ERC20MulticallMock multicallToken,
|
||
4 years ago
|
address[] calldata recipients,
|
||
|
uint256[] calldata amounts
|
||
|
) external {
|
||
4 years ago
|
bytes[] memory calls = new bytes[](recipients.length);
|
||
4 years ago
|
for (uint256 i = 0; i < recipients.length; i++) {
|
||
2 years ago
|
calls[i] = abi.encodeCall(multicallToken.transfer, (recipients[i], amounts[i]));
|
||
4 years ago
|
}
|
||
|
|
||
|
bytes[] memory results = multicallToken.multicall(calls);
|
||
4 years ago
|
for (uint256 i = 0; i < results.length; i++) {
|
||
4 years ago
|
require(abi.decode(results[i], (bool)));
|
||
|
}
|
||
|
}
|
||
|
}
|