Skip to content

Remove send (or, other options) #16011

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

Open
greenlucid opened this issue Apr 18, 2025 · 1 comment
Open

Remove send (or, other options) #16011

greenlucid opened this issue Apr 18, 2025 · 1 comment
Labels

Comments

@greenlucid
Copy link

send is in a limbo state. It's available, the compiler warns against using it, and there's no way to stop the warning.

From this post I assume the Solidity philosophy is that warnings cannot be hidden because they should be obeyed at most.

Is there still no // @ts-ignore equivalent for Solidity?

I want to stop getting this warning polluting my output and linting:

"Failure condition of 'send' ignored. Consider using 'transfer' instead."

This error is useless to me, I'm using send deliberately. If you think send should NOT be used and that's why a warning is always printed, then send SHOULD be removed from the compiler, not be held in a limbo in which using it forces a warning onto all developers. Post that @0xferit wrote on this back in 2021:

https://forum.soliditylang.org/t/which-compiler-warnings-do-you-ignore/89/4

But of course, send is useful sometimes, example:

https://github.com/kleros/tcr/blob/72e547ea135d839dc5db34e79e9f94f05c6a92bb/contracts/LightGeneralizedTCR.sol#L659

If this had used transfer instead, a malicious Contract that had the role of the requester that reverts upon receiving value, could be used to prevent the Request from being Ruled.

The recommended pattern in here could be used instead: https://docs.soliditylang.org/en/v0.8.29/common-patterns.html but it would increase the complexity of the contract, so a deliberate decision was made to assume that it is the users' responsibility to accept the ETH.

If you want people to use something like recipient.call{value: deposit, gas: 2300}("");, then the procedure should be to remove send as a function, print a warning/suggestion with the call pattern above. So send can finally die in peace and we no longer have to see this warning ever again.

Or alternatively you could just add the // @ts-ignore equivalent to Solidity.

@nadtech-hub
Copy link

May I take on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants