Description
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:
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.