-
Notifications
You must be signed in to change notification settings - Fork 66
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
refactor: setAuthorization
=> setAuthorizationWithSig
#235
Conversation
1831e20
to
8387959
Compare
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 don't have a strong opinion on this (I approved), but do you have specific reasons for this change ? In solidity, optional arguments are usually implemented using the same function name, and it kind of fits the bill here
It is not really optional arguments neither here. It is more a fundamentally different logic. |
Yes it's not the same thing, but from a very high level you give the authorization either by being the sender or by providing the additional "optional" arguments |
Julien also added the technical reasons why he opened the PR |
Pull request
Remove duplicated function name with different signatures to clarify the interface.
It is harder to type functions in any other language if the function name is the same but the behavior nor parameters are not.
The workaround (used on Morpho Optimizers) is to rename offchain the function, or define a function name more explicit (
setAuthorization(address,address,bool)
instead ofsetAutorization
for example) when we are interfacing blue, which is less readable.So to clarify everything, I suggest to have a more explicit function name