A challenger can win a battle without betting no CRED
.
When going on stage, a user can be either the defender or the challenger if there's no defender yet.
In the first case, their RPR
NFT is transferred to the arbiter (RapBattle.sol) and so their Credibility tokens (CRED).
However, in the second case, these precautions have not been taken. Their approvals to RapBattle
is not even checked.
Even so, the challenger could send their CRED
to another account before the battle ends, risking nothing in the end.
If the challenger (msg.sender) wins the battle, they will earn promised rewards.
If the challenger losses the battle, the CreToken transfer from their account could revert may be due to not enough funds, or no approval, or credToken unexpected behaviour.
This would revert the transaction and annul the battle even if we already had a winner.
This is unfair to the defender, who risks losing CRED
in the battle.
In the terminal, run the following command:
forge test --mt testChallengerWithNoRisk
Challenger can go on stage and win a battle without risk.
Manual review
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.