-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(TryMulticallClient): Use simulated gasLimit when sending multical…
…l txns (#1761) * fix(TryMulticallClient): Use simulated gasLimit when sending multicall transactions Signed-off-by: bennett <bennett@umaproject.org> --------- Signed-off-by: bennett <bennett@umaproject.org>
- Loading branch information
Showing
4 changed files
with
491 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//SPDX-License-Identifier: Unlicense | ||
pragma solidity ^0.8.0; | ||
|
||
/** | ||
* @title MockMulticallReceiver | ||
*/ | ||
contract MockMulticallReceiver { | ||
struct Result { | ||
bool success; | ||
bytes returnData; | ||
} | ||
|
||
/// @custom:oz-upgrades-unsafe-allow constructor | ||
constructor() {} // solhint-disable-line no-empty-blocks | ||
|
||
// Entrypoint for tryMulticall tests. For simplicity, a call will succeed if its MSB is nonzero. | ||
function tryMulticall(bytes[] calldata calls) external pure returns (Result[] memory) { | ||
Result[] memory results = new Result[](calls.length); | ||
for (uint256 i = 0; i < calls.length; ++i) { | ||
bool success = uint256(bytes32(calls[i])) != 0; | ||
results[i] = Result(success, calls[i]); | ||
} | ||
return results; | ||
} | ||
|
||
// In the MultiCallerClient, we require the contract we are calling to contain | ||
// multicall in order for the transaction to not be marked as unsendable. | ||
// https://github.com/across-protocol/relayer/blob/e56a6874419eeded58d64e77a1628b6541861b65/src/clients/MultiCallerClient.ts#L374 | ||
function multicall() external {} | ||
} |
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
Oops, something went wrong.