Wrong way to generate a random number during battle. The result is not a random number!
The following formula is used to generate the random number during the battle:
Neither block.timestamp
nor block.prevrandao
nor msg.sender
are random numbers and that is why the whole formula does not generate truly random number.
This way of choosing the battle winner can be manipulated by the challenger to win the battle. They have to enter the challenge in specific block timestamp to win the battle. See the test below.
Use this test in your test file. This test repeats at some defined timestamp. The two rappers have the same skills so it should be 50% chance of winning for each rapper. It is not! The challenger always wins.
For secure and unbiased random number generation use oracles like chainlink vrf (https://docs.chain.link/vrf)
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.