The fulfillRandomWords
function uses the send
method in order to send the reward to the winner. But this method can not be successfully executed.
The fulfillRandomWords
function sends to the winner of the raffle the reward - NFT and the balance of the contract:
In order to send the balance of the contract, the function uses the send
function. But these method has some limitations according to the Vyper documentation for version 0.3.10
. If these limitations are still valid in the new experimental version, they should be taken into account:
https://docs.vyperlang.org/en/v0.3.10/control-structures.html?highlight=send%5D#considerations
The documentation says that the Sending Ether
will lead to operation be out of gas.
Also, the send
method doesn't return any value about that if the transaction is successful.
If the transaction is not successfull the function will not revert and the winner will be not able to receive the reward.
Moreover, there is no check if the winner can receive ether
.
It will be impossible to win raffle if the winner is a smart contract without a fallback function.
Manual Review
Use raw_call
instead of send
and check the return value. Also, check if the winner can receive ethers.
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.