Skip to content

Commit

Permalink
add erics custom error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
tinaszheng committed Nov 21, 2023
1 parent 349ddb8 commit 906fb65
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contracts/base/Multicall.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ abstract contract Multicall is IMulticall {
(bool success, bytes memory result) = address(this).delegatecall(data[i]);

if (!success) {
// handle custom errors
if (result.length == 4) {
assembly {
revert(add(result, 0x20), mload(result))
}
}
// Next 5 lines from https://ethereum.stackexchange.com/a/83577
if (result.length < 68) revert();
assembly {
Expand Down

0 comments on commit 906fb65

Please sign in to comment.