-
Notifications
You must be signed in to change notification settings - Fork 77
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 check for invalid target. Closes #24 #25
base: master
Are you sure you want to change the base?
Conversation
@rainbreak what do you think about this change? apparently if you delegatecall to an address that doesn't have code it doesn't revert, just passes. I'm not sure if that is ok or not, but as we are checking if the |
With constantinople you can also consider |
Yeah, I was planning to take care of it in another PR. |
ahh @rainbreak you were meaning for this specific check, I thought you were talking about the possibility of simplifying the cache with the new opcode. Anyway I think using |
@rainbreak can we merge this? |
@@ -58,6 +58,11 @@ contract DSProxy is DSAuth, DSNote { | |||
returns (bytes memory response) | |||
{ | |||
require(_target != address(0), "ds-proxy-target-address-required"); | |||
uint csize; |
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.
Let's use codesize
?
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.
Can't use codesize
as variable name in assembly.
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.
codeSize
or code_size
work though. What do you prefer?
Are you still considering extcodehash? |
In the beginning I thought you were suggesting |
As per this other discussion in the OpenZeppelin repo, the gas cost for |
No description provided.