-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathLensHubInitializable.sol
63 lines (57 loc) · 2.08 KB
/
LensHubInitializable.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
54
55
56
57
58
59
60
61
62
63
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
import {LensHub} from 'contracts/LensHub.sol';
import {Types} from 'contracts/libraries/constants/Types.sol';
import {GovernanceLib} from 'contracts/libraries/GovernanceLib.sol';
import {ILensHubInitializable} from 'contracts/interfaces/ILensHubInitializable.sol';
import {VersionedInitializable} from 'contracts/base/upgradeability/VersionedInitializable.sol';
/**
* @title LensHubInitializable
* @author Lens Protocol
*
* @notice Extension of LensHub contract that includes initialization for fresh deployments.
*/
contract LensHubInitializable is LensHub, VersionedInitializable, ILensHubInitializable {
// Constant for upgradeability purposes, see VersionedInitializable.
// Do not confuse it with the EIP-712 version number.
uint256 internal constant REVISION = 1;
constructor(
address moduleGlobals,
address followNFTImpl,
address collectNFTImpl,
address lensHandlesAddress,
address tokenHandleRegistryAddress,
address legacyFeeFollowModule,
address legacyProfileFollowModule,
address newFeeFollowModule,
uint256 tokenGuardianCooldown
)
LensHub(
moduleGlobals,
followNFTImpl,
collectNFTImpl,
lensHandlesAddress,
tokenHandleRegistryAddress,
legacyFeeFollowModule,
legacyProfileFollowModule,
newFeeFollowModule,
tokenGuardianCooldown
)
{}
/**
* @inheritdoc ILensHubInitializable
* @custom:permissions Callable once. This is expected to be atomically called during the deployment by the Proxy.
*/
function initialize(
string calldata name,
string calldata symbol,
address newGovernance
) external override initializer {
super._initialize(name, symbol);
GovernanceLib.initState(Types.ProtocolState.Paused);
GovernanceLib.setGovernance(newGovernance);
}
function getRevision() internal pure virtual override returns (uint256) {
return REVISION;
}
}