-
Notifications
You must be signed in to change notification settings - Fork 991
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
Update ERC-7751 revert bubbling #889
Conversation
Forge code coverage:
|
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.
looks good to me
src/libraries/CustomRevert.sol
Outdated
/// @dev this function should only be used with custom errors of the type `CustomError(address target, bytes revertReason)` | ||
function bubbleUpAndRevertWith(bytes4 selector, address addr) internal pure { | ||
/// @notice bubble up the revert message returned by a call and revert with a wrapped ERC-7751 error | ||
function bubbleUpAndRevertWith(address target, bytes4 functionSelector, bytes4 additionalContext) internal pure { |
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.
consider renaming these to be a bit more clear, maybe:
address revertingContract
address revertingFunctionSelector
bytes4 additionalContext
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.
also -- why is additionalContext
only bytes4 here but bytes in the custom error? seems context could be a custom error w/ params so should we support that here too?
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 guess keeping it bytes4 makes the encoding more simple if we specifically dont plan on having params here
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.
any additional context we had in the reverts before was the target address (hook, erc20 token, recipient) based on the action, so we only needed 4bytes for the selector
No description provided.