-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Should call
(and family) check for extcodesize?
#4823
Comments
Also note that |
|
Is there a valid use case where you may want to send some That said, an example of such use case doesn't come to mind now. |
My gut feeling is that |
I agree with @frangio, but that I don't think it should be removed. Dealing with with inline assembly in program analysis tools is much harder, so IMO the least it's used the better. @spalladino I've seen extra |
@ajsantander note that this is not about sending ether, but just about sending data. The problem is that if you send data to an account that does not have code, it will be successful, even though you would expect some code to execute. I agree with keeping things simple, but we check for extcodesize with regular function calls and thus people might expect the same thing to happen for low-level calls. Note that this would also provide some kind of protection from "library" selfdestructs (note that libraries cannot selfdestruct anymore, you have to use the contract workaround that was actually also used in the two library-related bugs) combined with low-level delegatecall. The main question would be which use-case is more edge-casy: deliberately sending data to non-contract accounts or assuming that One resolution of this issue could also be: "call never checked for extcodesize so it should not start doing so now", especially if we cannot find strong arguments for either side. |
I think with introducing |
Agreed on todays meeting that this replaced #4910. The current behaviour is simpler and it isn't fully clear which option is better (having the check or not having the check), but by introducing a helper (as of #4910) the option is put in the hands of the user. @ajsantander @frangio @spalladino @alcuadrado please comment if you would like to keep this issue open and discussed further. |
Currently,
call
does not fail if the target contract does not exist. The idea is that it is a low-level thing.People might still not think about that.
On the other hand, this makes it impossible to use
call
for sending ether to external accounts.On the third hand, you should use
transfer
for that anyway.The text was updated successfully, but these errors were encountered: