-
Notifications
You must be signed in to change notification settings - Fork 8
/
LensV2Migration.sol
53 lines (44 loc) · 1.81 KB
/
LensV2Migration.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
import {MigrationLib} from 'contracts/libraries/MigrationLib.sol';
// Handles
import {LensHandles} from 'contracts/namespaces/LensHandles.sol';
import {TokenHandleRegistry} from 'contracts/namespaces/TokenHandleRegistry.sol';
contract LensV2Migration {
address internal immutable FEE_FOLLOW_MODULE;
address internal immutable PROFILE_FOLLOW_MODULE;
address internal immutable NEW_FEE_FOLLOW_MODULE;
LensHandles internal immutable lensHandles;
TokenHandleRegistry internal immutable tokenHandleRegistry;
constructor(
address legacyFeeFollowModule,
address legacyProfileFollowModule,
address newFeeFollowModule,
address lensHandlesAddress,
address tokenHandleRegistryAddress
) {
FEE_FOLLOW_MODULE = legacyFeeFollowModule;
PROFILE_FOLLOW_MODULE = legacyProfileFollowModule;
NEW_FEE_FOLLOW_MODULE = newFeeFollowModule;
lensHandles = LensHandles(lensHandlesAddress);
tokenHandleRegistry = TokenHandleRegistry(tokenHandleRegistryAddress);
}
function batchMigrateProfiles(uint256[] calldata profileIds) external {
MigrationLib.batchMigrateProfiles(profileIds, lensHandles, tokenHandleRegistry);
}
function batchMigrateFollows(
uint256[] calldata followerProfileIds,
uint256[] calldata idsOfProfileFollowed,
uint256[] calldata followTokenIds
) external {
MigrationLib.batchMigrateFollows(followerProfileIds, idsOfProfileFollowed, followTokenIds);
}
function batchMigrateFollowModules(uint256[] calldata profileIds) external {
MigrationLib.batchMigrateFollowModules(
profileIds,
FEE_FOLLOW_MODULE,
PROFILE_FOLLOW_MODULE,
NEW_FEE_FOLLOW_MODULE
);
}
}