-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* almost full coverage for comp * remove only * almost complete coverage comp * full comp coverage
- Loading branch information
Showing
4 changed files
with
457 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
Oops, something went wrong.