Uniswap's Multicall library incorrectly parses revert reason length and does not bubble up custom errors
Opened this issue · 0 comments
Uniswap's Multicall library only bubbles up revert reason when the length of the byte array is 68 >= (4 for error selector + 32 for string length + at least 32 for string content)
This leads to empty reverts even if the underlying contract implements custom errors.
Yearn-ERC4626-Router/src/external/Multicall.sol
Lines 15 to 24 in 6816577
Furthermore it seems like it incorrectly attempts to splice revertData, rather than splicing the 4 bytes selector, it shifts the pointer to the length of the bytes by 4 and leads to high length bytes. Ends up relying on abi.decode's behavior to deal with incorrect string length
Discussion from the Uniswap repo here: Uniswap/v3-periphery#254
Would be nice to replace this with a better (and correct) way to pass the revert data like from OZ