MulticallTestUpgradeable.sol 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "./MulticallTokenMockUpgradeable.sol";
  4. import "../proxy/utils/Initializable.sol";
  5. contract MulticallTestUpgradeable is Initializable {
  6. function __MulticallTest_init() internal onlyInitializing {
  7. }
  8. function __MulticallTest_init_unchained() internal onlyInitializing {
  9. }
  10. function testReturnValues(
  11. MulticallTokenMockUpgradeable multicallToken,
  12. address[] calldata recipients,
  13. uint256[] calldata amounts
  14. ) external {
  15. bytes[] memory calls = new bytes[](recipients.length);
  16. for (uint256 i = 0; i < recipients.length; i++) {
  17. calls[i] = abi.encodeWithSignature("transfer(address,uint256)", recipients[i], amounts[i]);
  18. }
  19. bytes[] memory results = multicallToken.multicall(calls);
  20. for (uint256 i = 0; i < results.length; i++) {
  21. require(abi.decode(results[i], (bool)));
  22. }
  23. }
  24. /**
  25. * @dev This empty reserved space is put in place to allow future versions to add new
  26. * variables without shifting down storage in the inheritance chain.
  27. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
  28. */
  29. uint256[50] private __gap;
  30. }