Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: erc20 auth calls #401
feat: erc20 auth calls #401
Changes from 11 commits
0b7df97
0572bce
203d624
11a1f78
7e13d44
40c5aaa
86bca2c
17f952d
ce5c0e7
c70fec4
4c3be31
d163373
f6c9514
f98eb2c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
nit: this can cause problems to developer experience if not properly documented what it means to fill or not the sender.
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.
this part is called by protocol, but i see your point, i think currently comment explain what its doing: sender = authenticated call, no sender = arbitrary call
when devs use this feature, they would set up callOptions.isArbitrary field on zevm side, so there is more important from devex side of things
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.
🛠️ Refactor suggestion
Consider using an explicit flag to indicate call type instead of checking
messageContext.sender
Currently, the code distinguishes between arbitrary and authenticated calls by checking if
messageContext.sender == address(0)
. While this approach works, it relies on a special value for the sender address, which can be less readable and might lead to errors if not handled carefully.Consider introducing an explicit boolean flag in
MessageContext
, such asisAuthenticated
, to make the distinction clearer and improve code readability:Then update the condition:
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.
💡 Codebase verification
Return value of
executeWithERC20
is not being capturedThe return value of
executeWithERC20
is not captured or returned in any of its calls. To ensure proper logging, error handling, or further processing, consider capturing the execution result as done in theexecute
function.🔗 Analysis chain
Verify if the execution result in
executeWithERC20
should be capturedIn the
execute
function, the result of the call is captured and returned to the caller. However, inexecuteWithERC20
, the result of_executeArbitraryCall
or_executeAuthenticatedCall
is neither captured nor returned. If the execution result is important for logging, error handling, or further processing, consider capturing and handling it similarly inexecuteWithERC20
.You can run the following script to check if any usage or overrides of
executeWithERC20
expect a return value:🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 158
Script:
Length of output: 1554
Script:
Length of output: 159
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.
Update Documentation to Match
MessageContext
StructureThe documentation for the
messageContext
parameter mentions that it contains "sender and arbitrary call flag," but theMessageContext
struct only includesaddress sender;
. Please update the documentation to accurately reflect the actual structure ofMessageContext
or include the "arbitrary call flag" in the struct if necessary.If the "arbitrary call flag" is not required, apply this diff to update the documentation:
/// @param messageContext Message context containing sender and arbitrary call flag. +/// @param messageContext Message context containing the sender address.
📝 Committable suggestion