Files
amateimaandGitHub 543bf555d3 improve(sdk): add support for Multicall2 contract (#3325)
* Add support for Multipart2 contract

Signed-off-by: amateima <[email protected]>

* Fix linter issue

Signed-off-by: amateima <[email protected]>

* Revert client to old implementation

Signed-off-by: amateima <[email protected]>

* Add Multicall2 separate client

Signed-off-by: amateima <[email protected]>

* Implement changes suggested in review

Signed-off-by: amateima <[email protected]>

* Improve tests

Signed-off-by: amateima <[email protected]>

* Improve typescript integration

Signed-off-by: amateima <[email protected]>

* Make contract abstract

Signed-off-by: amateima <[email protected]>
2021-08-27 23:48:58 +03:00

30 lines
884 B
Solidity

// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.5.0;
/**
* @title interface for MakerDao's Multicall2 contract.
* @dev This adds method to allow calls within the batch to fail
* @dev Full implementation can be found here: https://github.com/makerdao/multicall/blob/16ec5e2859b3a4829ceed4ee1ef609e6e9a744ee/src/Multicall2.sol
*/
abstract contract Multicall2 {
struct Call {
address target;
bytes callData;
}
struct Result {
bool success;
bytes returnData;
}
function aggregate(Call[] memory calls) public virtual returns (uint256 blockNumber, bytes[] memory returnData);
function tryBlockAndAggregate(bool requireSuccess, Call[] memory calls)
public
virtual
returns (
uint256 blockNumber,
bytes32 blockHash,
Result[] memory returnData
);
}