-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c137582
commit bdfe0f1
Showing
6 changed files
with
55 additions
and
0 deletions.
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
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,23 @@ | ||
pragma solidity >=0.5.0; | ||
|
||
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; | ||
|
||
contract Multicall is IERC721Receiver { | ||
struct Call { | ||
address target; | ||
bytes callData; | ||
uint256 value; | ||
} | ||
|
||
function aggregate(Call[] memory calls) external payable { | ||
for(uint256 i = 0; i < calls.length; i++) { | ||
(bool success, bytes memory ret) = calls[i].target.call{ value: calls[i].value}(calls[i].callData); | ||
require(success, "Multicall: call failed"); | ||
} | ||
} | ||
|
||
function onERC721Received(address, address, uint256, bytes calldata) | ||
public override pure returns(bytes4) { | ||
return this.onERC721Received.selector; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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