The GivingThanks.sol
contract currently lacks the ability to accept Ether sent directly to the contract. Without a receive()
or fallback()
function, any direct transfer of Ether to the contract will revert the transaction. Adding a receive()
function will allow the contract to accept Ether sent directly, ensuring that transactions don’t fail when Ether is mistakenly sent.
Low. Only suggesion for better practice
Failure to handle Ether transfers: Users who send Ether directly to the contract (either accidentally or intentionally) will cause the transaction to revert.
Loss of Ether: If the contract cannot accept Ether, users might lose funds if they mistakenly send Ether to the contract.
Manual review of the contract code
receive()
and/or fallback()
functionTo address this, we recommend adding a receive()
function to handle direct Ether transfers. Optionally, you can add a fallback()
function to handle transfers with data attached.
GivingThanks.sol
:Add a receive()
function to accept Ether with no data attached.
Optionally add a fallback()
function to handle any transfers that may include data.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.