Submitted by MiloTruck, also found by maanas and juancito
Profiles that exist before the V2 upgrade are migrated using the batchMigrateProfiles() function, which works by minting the profiles handle and linking it to their profile:
MigrationLib.sol#L69-L85
For example, a profile with the handle alice.lens will receive an alice LensHandles NFT post-migration.
However, whitelisted profile creators are able to mint any handle using mintHandle() in the LensHandles contract. This makes it possible for any whitelisted profile creator to mint a handle corresponding to a V1 profile before the profile is migrated.
If this occurs, batchMigrateProfiles() will always revert for the corresponding V1 profile as the same handle cannot be minted twice, thereby breaking migration for that profile.
If a whitelisted profile creator accidentally mints a handle that already belongs to a V1 profile, that profile cannot be migrated.
The Foundry test below demonstrates how batchMigrateProfiles() will revert if a V1 profiles handle has already been minted. It can be run with the following command:
Ensure that the handle of a V1 profile cannot be minted through mintHandle(). This validation will probably have to be done off-chain, as it is unfeasible to check all existing handles on-chain with a reasonable gas cost.
Upgradable
donosonaumczuk (Lens) confirmed commented:
