Closed chasebrownn closed 7 months ago
The RealReceiver::_migrateNFT and RealReceiver::_migrateNFTBatch functions will not emit the NFT IDs that were minted as a result of the migration thereby hindering user experience.
RealReceiver::_migrateNFT
RealReceiver::_migrateNFTBatch
/** * @notice Internal method for handling migration payloads for migrating to a veRWA NFT. * @param payload Payload containing NFT lock data. */ function _migrateNFT(bytes memory payload) internal { (, bytes memory toAddressBytes, uint256 amount, uint256 duration) = abi.decode(payload, (uint16, bytes, uint256, uint256)); address to = toAddressBytes.toAddress(0); (bool success,) = address(veRwaNFT).call( abi.encodeWithSignature("migrate(address,uint256,uint256)", to, amount, duration) ); if (!success) revert MigrationFailed(SEND_NFT); emit MigrationMessageReceived(SEND_NFT, to, payload); } /** * @notice Internal method for handling migration payloads for migrating a batch of veRWA NFTs. * @param payload Payload containing NFT lock data. */ function _migrateNFTBatch(bytes memory payload) internal { (, bytes memory toAddressBytes, uint256[] memory amounts, uint256[] memory durations) = abi.decode(payload, (uint16, bytes, uint256[], uint256[])); address to = toAddressBytes.toAddress(0); (bool success,) = address(veRwaNFT).call( abi.encodeWithSignature("migrateBatch(address,uint256[],uint256[])", to, amounts, durations) ); if (!success) revert MigrationFailed(SEND_NFT_BATCH); emit MigrationMessageReceived(SEND_NFT_BATCH, to, payload); }
We advise relevant events to be emitted by the RealReceiver properly signifying the IDs that were minted for the user as part of the migration.
RealReceiver
TokenId doesnt matter since it'll (more than likely) be minted on the other side as a completely different tokenId. The token being migrated is also chosen by the user on the front end
RRR-02C: Inexistent Emittance of Minted IDs
Description:
The
RealReceiver::_migrateNFT
andRealReceiver::_migrateNFTBatch
functions will not emit the NFT IDs that were minted as a result of the migration thereby hindering user experience.Example:
Recommendation:
We advise relevant events to be emitted by the
RealReceiver
properly signifying the IDs that were minted for the user as part of the migration.