Closed as not planned
Description
Description
I'm having to include this
/**
* @notice Fails on calls with no `msg.data` but with `msg.value`
*/
receive() external payable {
revert("bad call");
}
into the smart contract so it stops warning me about not using receive. I use fallback payable, but I need msg.data, so receive()
(calls with no msg.data, but msg.value) should always fail if I didn't defined a receive()
function
This warning is not fair: Warning: This contract has a payable fallback function, but no receive ether function. Consider adding a receive ether function.
If I add this receive function, that only reverts, than compiler will include it on the ABI of the contract. But this conflics with the warning and with https://solidity.readthedocs.io/en/v0.7.4/security-considerations.html#take-warnings-seriously
Instead, I added the first line of fallback as require(msg.data.length > 0, "bad call")
.
Metadata
Metadata
Assignees
Labels
The issue/PR was automatically closed due to inactivity.Any changes to the language, e.g. new featuresThere is not much implementation work to be done. The task is very easy or tiny.Changes are not very noticeable or potential benefits are limited.The issue/PR was marked as stale because it has been open for too long.