RapBattle::goOnStageOrBattle
allows the challenger to participate in battles without risking any of their own CRED
tokens as long as the bet is greater than the challenger balance. If the challenger loses the battle, the transaction will revert with ERC20InsufficientBalance
. This is due to the function not enforcing the challenger to have the required amount of tokens before participating in battles.
Add the following line to the imports of OneShotTest.t.sol
Copy-paste the testChallengerHasNothingToLose
function to the OneShotTest.t.sol
file
Run forge test --mt testChallengerHasNothingToLose -vv
in the terminal
There will be no rewards for the defender if they win the battle. The challenger can participate in battles without risking any of their own CRED
tokens as long as the bet is greater than the challenger balance.
Manual review
Enforce the challenger to have the required amount of tokens before participating in battles.
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.