Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

If a `RamNFT.sol` token is transferred to another address then the `ram` characteristic of the token will stay as the original minter

Summary

If a RamNFT.sol token is transferred to another address, then the ram characteristic of the token will not be updated to the new owner. It will stay as the original minter.

Vulnerability Details

Once a RamNFT is minted in the mintRamNFT function, the ram characteristic is set to the minters address.

function mintRamNFT(address to) public {
uint256 newTokenId = tokenCounter++;
_safeMint(to, newTokenId);
Characteristics[newTokenId] = CharacteristicsOfRam({
@> ram: to,
isJitaKrodhah: false,
isDhyutimaan: false,
isVidvaan: false,
isAatmavan: false,
isSatyavaakyah: false
});
}

If this token is then transferred to another address, the ram address is never updated and it will stay as the original minter. This means the token cannot be transferred and used for the event for the new owner. This can cause issues specifically if someone mints a token in wallet A and then wants to transfer it to a wallet B.

Impact

The test below passes showing that the ram characteristic stays as the original minter and not the new owner of the token.

function test_ramCharacteristicIsNotUpdatedOnTransfer() public {
vm.startPrank(player2);
ramNFT.mintRamNFT(player2);
ramNFT.transferFrom(player2, player1, 0);
assertEq(ramNFT.getCharacteristics(0).ram, player2);
}

Tools Used

--Foundry

Recommendations

It is recommended to either make the RamNFT's non-transferable or make it so the ram characteristic is updated to the new owner upon a transfer.

Updates

Lead Judging Commences

bube Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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