-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Add functionStaticCall and functionDelegateCall methods to Address library #2333
Add functionStaticCall and functionDelegateCall methods to Address library #2333
Conversation
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.
Thanks @k06a! Did you experiment with ways to avoid repeating the code? It seems the only thing that changes is the line with the actuall call. I wonder if Solidity's function types could be used here, and how gas would be affected.
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
@k06a Do you have any comments on the topic of avoiding the repeated code? |
@frangio we could aggregate only |
Ah that's a good point. I think we should at least be able to put the if conditional inside a separate private function that can be reused though. That would be a nice improvement. Could you try that out in this PR? |
…com/k06a/zeppelin-solidity into feature/address-delegate-and-static # Conflicts: # contracts/utils/Address.sol
@frangio did, can't make it work with function pointers because of |
@k06a This PR is great but you seem to have deleted the natspec documentation. 😄 Let me know if you can add it back, along with similar docs for the new functions, or if you want me to take care of it. Thank you! |
@frangio sorry about this, could someone help to restore it? You could simply push your own commits to my branch since I opened PR - it is allowed by github default settings :) |
No problem, I'll take care of it. |
Consider having
functionStaticCall
andfunctionDelegateCall
methods inAddress
library.