-
Notifications
You must be signed in to change notification settings - Fork 7
/
DeployProtocol.s.sol
43 lines (39 loc) · 1.74 KB
/
DeployProtocol.s.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
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.22 <0.9.0;
import { SablierV2LockupDynamic } from "@sablier/v2-core/src/SablierV2LockupDynamic.sol";
import { SablierV2LockupLinear } from "@sablier/v2-core/src/SablierV2LockupLinear.sol";
import { SablierV2LockupTranched } from "@sablier/v2-core/src/SablierV2LockupTranched.sol";
import { SablierV2NFTDescriptor } from "@sablier/v2-core/src/SablierV2NFTDescriptor.sol";
import { BaseScript } from "./Base.s.sol";
import { SablierV2MerkleLockupFactory } from "../src/SablierV2MerkleLockupFactory.sol";
import { SablierV2BatchLockup } from "../src/SablierV2BatchLockup.sol";
/// @notice Deploys the Sablier V2 Protocol.
contract DeployProtocol is BaseScript {
/// @dev Deploy via Forge.
function run(
address initialAdmin,
uint256 maxSegmentCount,
uint256 maxTrancheCount
)
public
virtual
broadcast
returns (
SablierV2LockupDynamic lockupDynamic,
SablierV2LockupLinear lockupLinear,
SablierV2LockupTranched lockupTranched,
SablierV2NFTDescriptor nftDescriptor,
SablierV2BatchLockup batchLockup,
SablierV2MerkleLockupFactory merkleLockupFactory
)
{
// Deploy V2 Core.
nftDescriptor = new SablierV2NFTDescriptor();
lockupDynamic = new SablierV2LockupDynamic(initialAdmin, nftDescriptor, maxSegmentCount);
lockupLinear = new SablierV2LockupLinear(initialAdmin, nftDescriptor);
lockupTranched = new SablierV2LockupTranched(initialAdmin, nftDescriptor, maxTrancheCount);
// Deploy V2 Periphery.
batchLockup = new SablierV2BatchLockup();
merkleLockupFactory = new SablierV2MerkleLockupFactory();
}
}