argotorg / argotorg/solidity

Remove `send` (or, other options)

Open
#16,011 1 comment 2 reactions 0 assignees View on GitHub
feature
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

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](https://forum.soliditylang.org/t/which-compiler-warnings-do-you-ignore/89) 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.

Contributor guide

Open the contributing guide

Research direction

The issue names no source files or tests. Start by reviewing the compiler warning for ignored `send` failures, the linked forum discussion, and the Solidity common-patterns documentation; done requires a decided, documented resolution among removing `send`, supporting warning suppression, or retaining the warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.