what's the best way to get rid of "Warning: Failure condition of 'send' ignored. Consider using 'transfer' instead."? i have a contract where i need to ignore the result of send() for good reasons

Jul 29, 2021, 8:30 AM
Assign the send transaction to a bool and ignore that variable
A mapping won't cost that much gas if you have less than 100 id check per transaction (estimate)
Jul 29, 2021, 8:51 AM
Could be upto 500
And using Matic ERC721, so gas is not an issue.
Jul 29, 2021, 8:52 AM
Put it on testnet and get an estimate with extreme conditions
Gas limit can be, so better test it out before implementing
Jul 29, 2021, 8:53 AM
Thanks, will do.
Jul 29, 2021, 8:55 AM
That would result in an unused variable warning. I'm trying to get back down to zero warnings after introducing those sends
Jul 29, 2021, 9:02 AM
Return that variable in the function.
Jul 29, 2021, 9:33 AM
I think it'd much rather do something stupid like

successful = sth.send(...);
successful = successful;

than change the function's interface
I'm not looking for any solution. I'm looking for the best solution
Jul 29, 2021, 9:35 AM
Redundant and useless, but works🙃
Jul 29, 2021, 9:35 AM
Like a comment that tells the compiler to skip that check
Jul 29, 2021, 9:35 AM
You cannot ignore compiler warnings. It was proposed, but rejected
Jul 29, 2021, 9:40 AM
Damn :(
Jul 29, 2021, 1:05 PM
If you think about it, it makes sense. You see a warning, there is an urge to remove it. So warnings will help to refactor the code more properly
Jul 29, 2021, 1:09 PM
If you think about it, having 4 compiler warnings bug you at all times for no reason, you're probably a lot slower even just to notice the presence of a 5th one
The first 4 bytes of the hash of its signature w/o any spaces
Jul 29, 2021, 2:16 PM
Know you, if possible work if doesn't know the label without hexa string?
Jul 29, 2021, 2:28 PM
I'm not sure what you're asking. But you can use functionname.selector to get the selector
Wtf!? I'm trying to help someone here and didn't have an internet connection when that message popped up (I'm on a train rn, so losing and gaining a connection all the time but sometimes it's out for 10 minutes)
But since i didn't get banned, you can have this link
https://ethereum.stackexchange.com/questions/72687/explanation-of-appending-selector-in-solidity-smart-contracts
You can also have this link to information on how to compute function selectors
https://solidity-by-example.org/function-selector/
Jul 29, 2021, 2:52 PM

© 2024 Draquery.com All rights reserved.