transfer()
in TwentyOne::EndGame()
is not recommend, as its fixed gas allocation might cause failure for recipients with complex logic in their receive or fallback functions.
If the recipient is a smart contract with complex logic in its receive/fallback functions, the transfer will revert. The provided test code demonstrates this by creating a FakeRecipient
contract that can cause an out-of-gas error.
Potential failure of prize transfers to smart contract recipients with complex receive or fallback functions.
Manual Review
Consider using .call{value: amount} instead for greater flexibility:
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.