Open maAPPsDEV opened 2 years ago
We completely agree, with our clients we recommend updating the multicall revert to:
assembly {
revert(add(result,32), mload(result))
}
Just blindly passing the revert bytes seems the most desirable solution in our opinion. The uniswap multicall only works with revert("string") errors and not with revert error(); errors, which in our opinion seems highly undesirable. It also does weird assembly magic as it shifts the error signature into the result.length, which is obviously undesirable.
Background
In
Multicall.sol
, it tries to decode revert messages in order to bubble the reason up. Originally, inspired by https://ethereum.stackexchange.com/a/83577Description
The current implementation for decoding revert messages is incorrect. It screws up the length of
_returnData
before passing it toabi.decode
. The screwed up length is much bigger than it should be. As long asabi.decode()
ignores the length of bytes data input, it doesn't lead to any flaws. But it doesn't need to rely on it.