Skip to content

Commit

Permalink
Add Coverage for Comp (#4)
Browse files Browse the repository at this point in the history
* almost full coverage for comp

* remove only

* almost complete coverage comp

* full comp coverage
  • Loading branch information
arr00 authored Jul 6, 2023
1 parent d5f17c8 commit 8942e44
Show file tree
Hide file tree
Showing 4 changed files with 457 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .solcover.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
skipFiles: ["GovernorAlpha.sol", "SafeMath.sol"],
skipFiles: ["GovernorAlpha.sol", "SafeMath.sol", "test/"],
};
28 changes: 28 additions & 0 deletions contracts/test/Multicall.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

/// @title Multicall - Aggregate results from multiple read-only function calls
/// @author Michael Elliot <[email protected]>
/// @author Joshua Levine <[email protected]>
/// @author Nick Johnson <[email protected]>

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

function aggregate(
Call[] memory calls
) public returns (uint256 blockNumber, bytes[] memory returnData) {
blockNumber = block.number;
returnData = new bytes[](calls.length);
for (uint256 i = 0; i < calls.length; i++) {
(bool success, bytes memory ret) = calls[i].target.call(
calls[i].callData
);
require(success);
returnData[i] = ret;
}
}
}
Loading

0 comments on commit 8942e44

Please sign in to comment.