Skip to content

Commit

Permalink
script: update init scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
smol-ninja committed Feb 18, 2025
1 parent 569ffdc commit 9625a83
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 16 deletions.
19 changes: 15 additions & 4 deletions script/CreateMerkleInstant.s.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.22 <0.9.0;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import { ISablierMerkleFactory } from "../src/interfaces/ISablierMerkleFactory.sol";
import { ISablierMerkleInstant } from "../src/interfaces/ISablierMerkleInstant.sol";
import { MerkleBase } from "../src/types/DataTypes.sol";
Expand All @@ -10,17 +12,26 @@ import { BaseScript } from "./Base.s.sol";
/// @dev Creates a dummy campaign to airdrop tokens instantly.
contract CreateMerkleInstant is BaseScript {
/// @dev Deploy via Forge.
function run() public broadcast returns (ISablierMerkleInstant merkleInstant) {
ISablierMerkleFactory merkleFactory = ISablierMerkleFactory(0x71DD3Ca88E7564416E5C2E350090C12Bf8F6144a);

function run(
ISablierMerkleFactory merkleFactory,
IERC20 token
)
public
virtual
broadcast
returns (ISablierMerkleInstant merkleInstant)
{
// Prepare the constructor parameters.
MerkleBase.ConstructorParams memory baseParams;

// The token to distribute through the campaign.
baseParams.token = token;

// The campaign will expire in 30 days.
baseParams.expiration = uint40(block.timestamp + 30 days);

// The admin of the campaign.
baseParams.initialAdmin = 0x79Fb3e81aAc012c08501f41296CCC145a1E15844;
baseParams.initialAdmin = broadcaster;

// Dummy values for the campaign name, IPFS CID, and the Merkle root hash.
baseParams.campaignName = "The Boys Instant";
Expand Down
19 changes: 13 additions & 6 deletions script/CreateMerkleLL.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,27 @@ import { BaseScript } from "./Base.s.sol";
/// @dev Creates a dummy campaign to airdrop tokens through Lockup Linear.
contract CreateMerkleLL is BaseScript {
/// @dev Deploy via Forge.
function run() public broadcast returns (ISablierMerkleLL merkleLL) {
ISablierMerkleFactory merkleFactory = ISablierMerkleFactory(0x71DD3Ca88E7564416E5C2E350090C12Bf8F6144a);

function run(
ISablierMerkleFactory merkleFactory,
ISablierLockup lockup,
IERC20 token
)
public
virtual
broadcast
returns (ISablierMerkleLL merkleLL)
{
// Prepare the constructor parameters.
MerkleBase.ConstructorParams memory baseParams;

// The token to distribute through the campaign.
baseParams.token = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F);
baseParams.token = token;

// The campaign will expire in 30 days.
baseParams.expiration = uint40(block.timestamp + 30 days);

// The admin of the campaign.
baseParams.initialAdmin = 0x79Fb3e81aAc012c08501f41296CCC145a1E15844;
baseParams.initialAdmin = broadcaster;

// Dummy values for the campaign name, IPFS CID, and the Merkle root hash.
baseParams.campaignName = "The Boys LL";
Expand All @@ -37,7 +44,7 @@ contract CreateMerkleLL is BaseScript {
// Deploy the MerkleLL contract.
merkleLL = merkleFactory.createMerkleLL({
baseParams: baseParams,
lockup: ISablierLockup(0x7C01AA3783577E15fD7e272443D44B92d5b21056),
lockup: lockup,
cancelable: true,
transferable: true,
schedule: MerkleLL.Schedule({
Expand Down
19 changes: 13 additions & 6 deletions script/CreateMerkleLT.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,27 @@ import { BaseScript } from "./Base.s.sol";
/// @dev Creates a dummy campaign to airdrop tokens through Lockup Tranched.
contract CreateMerkleLT is BaseScript {
/// @dev Deploy via Forge.
function run() public broadcast returns (ISablierMerkleLT merkleLT) {
ISablierMerkleFactory merkleFactory = ISablierMerkleFactory(0x71DD3Ca88E7564416E5C2E350090C12Bf8F6144a);

function run(
ISablierMerkleFactory merkleFactory,
ISablierLockup lockup,
IERC20 token
)
public
virtual
broadcast
returns (ISablierMerkleLT merkleLT)
{
// Prepare the constructor parameters.
MerkleBase.ConstructorParams memory baseParams;

// The token to distribute through the campaign.
baseParams.token = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F);
baseParams.token = token;

// The campaign will expire in 30 days.
baseParams.expiration = uint40(block.timestamp + 30 days);

// The admin of the campaign.
baseParams.initialAdmin = 0x79Fb3e81aAc012c08501f41296CCC145a1E15844;
baseParams.initialAdmin = broadcaster;

// Dummy values for the campaign name, IPFS CID, and the Merkle root hash.
baseParams.campaignName = "The Boys LT";
Expand All @@ -44,7 +51,7 @@ contract CreateMerkleLT is BaseScript {
// Deploy the MerkleLT contract.
merkleLT = merkleFactory.createMerkleLT({
baseParams: baseParams,
lockup: ISablierLockup(0x7C01AA3783577E15fD7e272443D44B92d5b21056),
lockup: lockup,
cancelable: true,
transferable: true,
streamStartTime: 0, // i.e. block.timestamp
Expand Down

0 comments on commit 9625a83

Please sign in to comment.