Submitted by shenwilly, also found by gzeon
CidNFT.sol#L147-L157
CidNFT.sol#L177-L182
CidNFT.mint() has an optional parameter _addList that enables users to register subprotocol NFTs to the CID NFT right after the mint.
However, there is no guarantee that the _cidNFTID  encoded in _addList is the same ID as the newly minted NFT. If there is a pending mint transaction and another user frontrun the mint transaction with higher fee, the previous transaction will revert as the _cidNFTID is no longer the expected ID.
CidNFT.sol#L177-L182
A malicious actor can grief this by frontrunning users that try to mint with non-zero _addList, causing their mint transaction to fail.
In absence of malicious actor, it is also possible for this issue to happen randomly during busy period where a lot of users are trying to mint at the same time.
Modify mint so that the minted ID is the one used during the add loop, ensuring that mint will always succeed.
berndartmueller (judge) commented:
OpenCoreCH (Canto Identity) confirmed
