-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
95 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity >=0.8.19 <0.9.0; | ||
|
||
import { ISablierV2Comptroller } from "../src/interfaces/ISablierV2Comptroller.sol"; | ||
import { SablierV2NFTDescriptor } from "../src/SablierV2NFTDescriptor.sol"; | ||
import { SablierV2LockupDynamic } from "../src/SablierV2LockupDynamic.sol"; | ||
import { SablierV2LockupLinear } from "../src/SablierV2LockupLinear.sol"; | ||
|
||
import { BaseScript } from "./Base.s.sol"; | ||
|
||
/// @notice Deploys all V2 Core contract in the following order: | ||
/// | ||
/// 1. {SablierV2NFTDescriptor} | ||
/// 2. {SablierV2LockupDynamic} | ||
/// 3. {SablierV2LockupLinear} | ||
contract DeployCore3 is BaseScript { | ||
function run( | ||
address initialAdmin, | ||
ISablierV2Comptroller comptroller, | ||
uint256 maxSegmentCount | ||
) | ||
public | ||
virtual | ||
broadcast | ||
returns ( | ||
SablierV2NFTDescriptor nftDescriptor, | ||
SablierV2LockupDynamic lockupDynamic, | ||
SablierV2LockupLinear lockupLinear | ||
) | ||
{ | ||
nftDescriptor = new SablierV2NFTDescriptor(); | ||
lockupDynamic = new SablierV2LockupDynamic(initialAdmin, comptroller, nftDescriptor, maxSegmentCount); | ||
lockupLinear = new SablierV2LockupLinear(initialAdmin, comptroller, nftDescriptor); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity >=0.8.19 <0.9.0; | ||
|
||
import { ISablierV2Comptroller } from "../src/interfaces/ISablierV2Comptroller.sol"; | ||
import { SablierV2NFTDescriptor } from "../src/SablierV2NFTDescriptor.sol"; | ||
import { SablierV2LockupDynamic } from "../src/SablierV2LockupDynamic.sol"; | ||
import { SablierV2LockupLinear } from "../src/SablierV2LockupLinear.sol"; | ||
|
||
import { BaseScript } from "./Base.s.sol"; | ||
|
||
/// @notice Deploys all V2 Core contracts at deterministic addresses across chains, in the following order: | ||
/// | ||
/// 1. {SablierV2Comptroller} | ||
/// 2. {SablierV2LockupDynamic} | ||
/// 3. {SablierV2LockupLinear} | ||
/// | ||
/// @dev Reverts if any contract has already been deployed. | ||
contract DeployDeterministicCore3 is BaseScript { | ||
/// @dev The presence of the salt instructs Forge to deploy the contract via a deterministic CREATE2 factory. | ||
/// https://github.com/Arachnid/deterministic-deployment-proxy | ||
function run( | ||
string memory create2Salt, | ||
address initialAdmin, | ||
ISablierV2Comptroller comptroller, | ||
uint256 maxSegmentCount | ||
) | ||
public | ||
virtual | ||
broadcast | ||
returns ( | ||
SablierV2NFTDescriptor nftDescriptor, | ||
SablierV2LockupDynamic lockupDynamic, | ||
SablierV2LockupLinear lockupLinear | ||
) | ||
{ | ||
bytes32 salt = bytes32(abi.encodePacked(create2Salt)); | ||
nftDescriptor = new SablierV2NFTDescriptor{ salt: salt }(); | ||
// forgefmt: disable-next-line | ||
lockupDynamic = | ||
new SablierV2LockupDynamic{ salt: salt }(initialAdmin, comptroller, nftDescriptor, maxSegmentCount); | ||
lockupLinear = new SablierV2LockupLinear{ salt: salt }(initialAdmin, comptroller, nftDescriptor); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters