MigrationLib
State Variables
LENS_PROTOCOL_PROFILE_ID
uint256 internal constant LENS_PROTOCOL_PROFILE_ID = 1;
DOT_LENS_SUFFIX_LENGTH
uint256 internal constant DOT_LENS_SUFFIX_LENGTH = 5;
Functions
batchMigrateProfiles
Migrates an array of profiles from V1 to V2. This function can be callable by anyone. We would still perform the migration in batches by ourselves, but good to allow users to migrate on their own if they want to.
function batchMigrateProfiles(
uint256[] calldata profileIds,
LensHandles lensHandles,
TokenHandleRegistry tokenHandleRegistry
) external;
Parameters
Name | Type | Description |
---|---|---|
profileIds | uint256[] | The array of profile IDs to migrate. |
lensHandles | LensHandles | |
tokenHandleRegistry | TokenHandleRegistry |
_migrateProfile
Migrates a profile from V1 to V2.
We do not revert in any case, as we want to allow the migration to continue even if one profile fails (and it usually fails if already migrated or profileNFT moved).
Estimated gas cost of one profile migration is around 178k gas.
function _migrateProfile(uint256 profileId, LensHandles lensHandles, TokenHandleRegistry tokenHandleRegistry) private;
Parameters
Name | Type | Description |
---|---|---|
profileId | uint256 | The profile ID to migrate. |
lensHandles | LensHandles | |
tokenHandleRegistry | TokenHandleRegistry |
batchMigrateFollows
function batchMigrateFollows(
uint256 followerProfileIds,
uint256[] calldata idsOfProfileFollowed,
uint256[] calldata followTokenIds
) external;
batchMigrateFollowers
function batchMigrateFollowers(
uint256[] calldata followerProfileIds,
uint256 idOfProfileFollowed,
uint256[] calldata followTokenIds
) external;
_migrateFollow
function _migrateFollow(
address followNFT,
uint256 followerProfileId,
uint256 idOfProfileFollowed,
uint256 followTokenId
) private;
batchMigrateFollowModules
function batchMigrateFollowModules(
uint256[] calldata profileIds,
address legacyFeeFollowModule,
address legacyProfileFollowModule,
address newFeeFollowModule
) external;
Events
ProfileMigrated
event ProfileMigrated(uint256 profileId, address profileDestination, string handle, uint256 handleId);