misc: make txExecutor address(0) on all migration events T-16784

This commit is contained in:
vicnaum
2023-10-12 08:10:30 +02:00
parent 50dfe6dd04
commit aefe48f6f0
2 changed files with 17 additions and 7 deletions

View File

@@ -196,19 +196,29 @@ library MigrationLib {
ILegacyFeeFollowModule.ProfileData memory feeFollowModuleData = ILegacyFeeFollowModule(
legacyFeeFollowModule
).getProfileData(profileIds[i]);
IFollowModule(newFeeFollowModule).initializeFollowModule({
bytes memory followModuleInitData = abi.encode(
feeFollowModuleData.currency,
feeFollowModuleData.amount,
feeFollowModuleData.recipient
);
bytes memory followModuleReturnData = IFollowModule(newFeeFollowModule).initializeFollowModule({
profileId: profileIds[i],
transactionExecutor: msg.sender, // TODO: Review
data: abi.encode(
feeFollowModuleData.currency,
feeFollowModuleData.amount,
feeFollowModuleData.recipient
)
data: followModuleInitData
});
emit Events.FollowModuleSet(
profileIds[i],
newFeeFollowModule,
followModuleInitData,
followModuleReturnData,
address(0),
block.timestamp
);
} else if (currentFollowModule == legacyProfileFollowModule) {
// If the profile had `ProfileFollowModule` set, we just remove the follow module, as in Lens V2
// you can only follow with a Lens profile.
delete StorageLib.getProfile(profileIds[i]).followModule;
emit Events.FollowModuleSet(profileIds[i], address(0), '', '', address(0), block.timestamp);
}
unchecked {
++i;

View File

@@ -46,7 +46,7 @@ contract TokenHandleRegistry is ITokenHandleRegistry {
_executeLinkage(
RegistryTypes.Handle({collection: LENS_HANDLES, id: handleId}),
RegistryTypes.Token({collection: LENS_HUB, id: profileId}),
msg.sender
address(0)
);
}