Skip to content

Commit

Permalink
refactor: rename functions
Browse files Browse the repository at this point in the history
  • Loading branch information
andreivladbrg committed Jan 21, 2025
1 parent 3982dde commit 5328ac3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
17 changes: 10 additions & 7 deletions airdrops/MerkleCreator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,23 @@ contract MerkleCreator {
// The total number of addresses you want to airdrop your tokens to.
uint256 recipientCount = 10_000;

// Set the schedule of the stream that will be created from this campaign.
MerkleLL.Schedule memory schedule = MerkleLL.Schedule({
startTime: 0, // i.e. block.timestamp
startPercentage: ud2x18(0.01e18),
cliffDuration: 30 days,
cliffPercentage: ud2x18(0.01e18),
totalDuration: 90 days
});

// Deploy the MerkleLL campaign contract. The deployed contract will be completely owned by the campaign admin.
// Recipients will interact with the deployed contract to claim their airdrop.
merkleLL = FACTORY.createMerkleLL({
baseParams: baseParams,
lockup: LOCKUP,
cancelable: false,
transferable: true,
schedule: MerkleLL.Schedule({
startTime: 0, // i.e. block.timestamp
startPercentage: ud2x18(0.01e18),
cliffDuration: 30 days,
cliffPercentage: ud2x18(0.01e18),
totalDuration: 90 days
}),
schedule: schedule,
aggregateAmount: aggregateAmount,
recipientCount: recipientCount
});
Expand Down
10 changes: 5 additions & 5 deletions lockup/LockupLinearCurvesCreator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ contract LockupLinearCurvesCreator {
}

/// @dev For this function to work, the sender must have approved this dummy contract to spend DAI.
function createStream_Cliff() public returns (uint256 streamId) {
function createStream_CliffUnlock() public returns (uint256 streamId) {
// Declare the total amount as 100 DAI
uint128 totalAmount = 100e18;

Expand Down Expand Up @@ -83,7 +83,7 @@ contract LockupLinearCurvesCreator {
}

/// @dev For this function to work, the sender must have approved this dummy contract to spend DAI.
function createStream_UnlockLinear() public returns (uint256 streamId) {
function createStream_InitialUnlock() public returns (uint256 streamId) {
// Declare the total amount as 100 DAI
uint128 totalAmount = 100e18;

Expand Down Expand Up @@ -117,7 +117,7 @@ contract LockupLinearCurvesCreator {
}

/// @dev For this function to work, the sender must have approved this dummy contract to spend DAI.
function createStream_UnlockCliff() public returns (uint256 streamId) {
function createStream_InitialCliffUnlock() public returns (uint256 streamId) {
// Declare the total amount as 100 DAI
uint128 totalAmount = 100e18;

Expand Down Expand Up @@ -151,7 +151,7 @@ contract LockupLinearCurvesCreator {
}

/// @dev For this function to work, the sender must have approved this dummy contract to spend DAI.
function createStream_ConstantLinear() public returns (uint256 streamId) {
function createStream_ConstantCliff() public returns (uint256 streamId) {
// Declare the total amount as 100 DAI
uint128 totalAmount = 100e18;

Expand Down Expand Up @@ -184,7 +184,7 @@ contract LockupLinearCurvesCreator {
}

/// @dev For this function to work, the sender must have approved this dummy contract to spend DAI.
function createStream_UnlockConstant() public returns (uint256 streamId) {
function createStream_InitialUnlockConstantCliff() public returns (uint256 streamId) {
// Declare the total amount as 100 DAI
uint128 totalAmount = 100e18;

Expand Down
20 changes: 10 additions & 10 deletions lockup/LockupLinearCurvesCreator.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ contract LockupLinearCurvesCreatorTest is Test {
assertEq(actualStreamedAmount, expectedStreamedAmount);
}

function test_CreateStream_Cliff() external {
function test_CreateStream_CliffUnlock() external {
uint256 expectedStreamId = creator.LOCKUP().nextStreamId();
uint256 actualStreamId = creator.createStream_Cliff();
uint256 actualStreamId = creator.createStream_CliffUnlock();

// Assert that the stream has been created.
assertEq(actualStreamId, expectedStreamId);
Expand Down Expand Up @@ -95,9 +95,9 @@ contract LockupLinearCurvesCreatorTest is Test {
assertApproxEqAbs(actualStreamedAmount, expectedStreamedAmount, 100, "cliff unlock amount + linear streaming");
}

function test_CreateStream_UnlockLinear() external {
function test_CreateStream_InitialUnlock() external {
uint256 expectedStreamId = creator.LOCKUP().nextStreamId();
uint256 actualStreamId = creator.createStream_UnlockLinear();
uint256 actualStreamId = creator.createStream_InitialUnlock();

// Assert that the stream has been created.
assertEq(actualStreamId, expectedStreamId);
Expand All @@ -119,9 +119,9 @@ contract LockupLinearCurvesCreatorTest is Test {
assertEq(actualStreamedAmount, expectedStreamedAmount);
}

function test_CreateStream_UnlockCliff() external {
function test_CreateStream_InitialCliffUnlock() external {
uint256 expectedStreamId = creator.LOCKUP().nextStreamId();
uint256 actualStreamId = creator.createStream_UnlockCliff();
uint256 actualStreamId = creator.createStream_InitialCliffUnlock();

// Assert that the stream has been created.
assertEq(actualStreamId, expectedStreamId);
Expand Down Expand Up @@ -157,9 +157,9 @@ contract LockupLinearCurvesCreatorTest is Test {
assertApproxEqAbs(actualStreamedAmount, expectedStreamedAmount, 100, "linear streaming after cliff");
}

function test_CreateStream_ConstantLinear() external {
function test_CreateStream_ConstantCliff() external {
uint256 expectedStreamId = creator.LOCKUP().nextStreamId();
uint256 actualStreamId = creator.createStream_ConstantLinear();
uint256 actualStreamId = creator.createStream_ConstantCliff();

// Assert that the stream has been created.
assertEq(actualStreamId, expectedStreamId);
Expand Down Expand Up @@ -190,9 +190,9 @@ contract LockupLinearCurvesCreatorTest is Test {
assertEq(actualStreamedAmount, expectedStreamedAmount, "linear streaming");
}

function test_CreateStream_UnlockConstant() external {
function test_CreateStream_InitialUnlockConstantCliff() external {
uint256 expectedStreamId = creator.LOCKUP().nextStreamId();
uint256 actualStreamId = creator.createStream_UnlockConstant();
uint256 actualStreamId = creator.createStream_InitialUnlockConstantCliff();

// Assert that the stream has been created.
assertEq(actualStreamId, expectedStreamId);
Expand Down

0 comments on commit 5328ac3

Please sign in to comment.