diff --git a/contracts/base/Multicall.sol b/contracts/base/Multicall.sol index 5eccb34c..bd926766 100644 --- a/contracts/base/Multicall.sol +++ b/contracts/base/Multicall.sol @@ -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 {