_safeMint is in the wrong position, there is a risk of reentrancy vulnerability.
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/tokens/RAACNFT.sol#L32-L50
From the _checkOnERC721Received() function, when calling the IERC721Receiver(to).onERC721Received function, the unknown address to is called. At this time, if to is a contract address, we call the mint() function of the attacked contract again in the onERC721Received() function of the contract to complete the reentrancy.
Without a mechanism to prevent reentrancy attacks, a malicious contract could call the mint function multiple times, causing additional NFTs to be minted or user funds to be improperly processed.
Manual review
All conditions should be checked and status updated before interacting with external contracts:
_safeMint is placed at the bottom of the mint 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.