The battlesWon property of Nft metadata of the winning rapper in a rap battle is never updated.
After winning a rap battle, it is expected that the rapper NFT's battlesWon metadata property is incremented by 1. However, this detail was missed in the protocol code.
Put the following function in the test contract of your Foundry test file:
The test passes:
Rapper tokenIds with higher number of battles won should be more collectible and reputable. It also helps users keep track of the number of battles they have won. Invalid/stale Nft metadata is not desirable as well.
Foundry, VSCodium.
In OneShot contract, first allow the RapBattle contract to update the Nft metadata. Then, in RapBattle::_battle
function, update the battlesWon property of the winner by calling OneShot::updateRapperStats
function.
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.