-
Notifications
You must be signed in to change notification settings - Fork 5.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 a "safe way to send ether" i.e. address.transfer #610
Comments
LGTM. When this is implemented, could a warning message when |
As we've seen in the past couple weeks, |
Wouldn't the main suggested use for In that case it should by default include gas enough for that only and offer the ie. |
I think it may make sense rejecting 0 value transfers as those seem like circumventing the real purpose of transfer. |
Is error bubbling the only difference between send and transfer? I am worried that people may confuse these two, since there is little semantic clue in those names to distinguish between them. Also, if the plan is to eventually deprecate send (to avoid this confusion), what would be the recommended migration path? Contracts could easily lock themselves if they carelessly replace send with transfer, right? |
Two differences:
See #1666. Both will be available,
If they just replace it and the target throws, then I guess they could have situation their code won't progress forward. Hence this has a new method name and we're not changing |
Thanks for the clarification! |
This is implemented in develop. |
I am wondering about .gas() modifier: when I tried to use it, I got member gas not found or not visible compilation error (with compiler 0.4.13). Even after changing the compiler versions in Remix, the same compilation error happens. |
@Gergia the |
No, I thought it supported |
Sorry, this issue was only an in-progress discussion. The documentation contains the final decision. Left a comment on stackexchange. |
Still it is not working. |
address.send
does not send along any gas and does not propagate exceptions. This is good for situation where we do not know the target, but those are limited in use as was discovered in the meantime. People resort to workarounds likerecipient.call.value(x)()
. Exactly this workaround should receive a name and it should propagate exceptions.Suggestions for the name:
transfer
(sounds safer because transfer usually asks you to watch the whole process)The text was updated successfully, but these errors were encountered: