-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multicall: bubble up revert reason #236
Conversation
src/base/Multicall.sol
Outdated
@@ -20,7 +26,7 @@ abstract contract Multicall is IMulticall { | |||
} | |||
} | |||
// Next 5 lines from https://ethereum.stackexchange.com/a/83577 | |||
if (result.length < 68) revert(); | |||
if (result.length < 68) CallFailed.selector.bubbleUpAndRevertWith(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about this 68 length check.. but why wouldnt we want to bubble up if > 68 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because in old-solidity errors couldnt be less than 68 bytes, so it meant there was no error to bubble
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think once you merge the other bubble reverts into this PR would be nice to test with those Wrapped reverts to make sure we're surfacing those properly in the multicall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noice looks good to me
// confirm expected length of the revert | ||
try multicall.revertWithBytes(data) {} | ||
catch (bytes memory reason) { | ||
// errors with 0 bytes are by default 64 bytes of data (length & pointer?) + 4 bytes of selector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errors with 0 bytes of data outside the selector? thats super interesting.. didnt know that i guess that explains the 68 number
Related Issue
Closes #175
Description of changes
Modify Multicall.sol to bubble up custom reverts with arguments