diff --git a/benchmark/BatchLockup.Gas.t.sol b/benchmark/BatchLockup.Gas.t.sol index 803ddc44..6ac28654 100644 --- a/benchmark/BatchLockup.Gas.t.sol +++ b/benchmark/BatchLockup.Gas.t.sol @@ -58,7 +58,7 @@ contract BatchLockup_Gas_Test is Benchmark_Test { function gasCreateWithDurationsLD(uint256 batchSize, uint256 segmentsCount) internal { BatchLockup.CreateWithDurationsLD[] memory params = BatchLockupBuilder.fillBatch({ - batchSingle: defaults.createWithDurationsLD({ + params: defaults.createWithDurationsLD({ asset_: dai, totalAmount_: uint128(AMOUNT_PER_ITEM * segmentsCount), segments_: _generateSegmentsWithDuration(segmentsCount) @@ -86,7 +86,7 @@ contract BatchLockup_Gas_Test is Benchmark_Test { function gasCreateWithTimestampsLD(uint256 batchSize, uint256 segmentsCount) internal { BatchLockup.CreateWithTimestampsLD[] memory params = BatchLockupBuilder.fillBatch({ - batchSingle: defaults.createWithTimestampsLD({ + params: defaults.createWithTimestampsLD({ asset_: dai, totalAmount_: uint128(AMOUNT_PER_ITEM * segmentsCount), segments_: _generateSegments(segmentsCount) @@ -114,14 +114,14 @@ contract BatchLockup_Gas_Test is Benchmark_Test { function gasCreateWithDurationsLL(uint256 batchSize) internal { BatchLockup.CreateWithDurationsLL[] memory params = - BatchLockupBuilder.fillBatch({ batchSingle: defaults.createWithDurationsLL(dai), batchSize: batchSize }); + BatchLockupBuilder.fillBatch({ params: defaults.createWithDurationsLL(dai), batchSize: batchSize }); uint256 initialGas = gasleft(); batchLockup.createWithDurationsLL(lockupLinear, dai, params); string memory gasUsed = vm.toString(initialGas - gasleft()); contentToAppend = string.concat( - "| `createWithDurationsLL` | Lockup Linear | |", vm.toString(batchSize), " | ", gasUsed, " |" + "| `createWithDurationsLL` | Lockup Linear | N/A |", vm.toString(batchSize), " | ", gasUsed, " |" ); // Append the content to the file. @@ -130,14 +130,14 @@ contract BatchLockup_Gas_Test is Benchmark_Test { function gasCreateWithTimestampsLL(uint256 batchSize) internal { BatchLockup.CreateWithTimestampsLL[] memory params = - BatchLockupBuilder.fillBatch({ batchSingle: defaults.createWithTimestampsLL(dai), batchSize: batchSize }); + BatchLockupBuilder.fillBatch({ params: defaults.createWithTimestampsLL(dai), batchSize: batchSize }); uint256 initialGas = gasleft(); batchLockup.createWithTimestampsLL(lockupLinear, dai, params); string memory gasUsed = vm.toString(initialGas - gasleft()); contentToAppend = string.concat( - "| `createWithTimestampsLL` | Lockup Linear | |", vm.toString(batchSize), " | ", gasUsed, " |" + "| `createWithTimestampsLL` | Lockup Linear | N/A |", vm.toString(batchSize), " | ", gasUsed, " |" ); // Append the data to the file @@ -146,7 +146,7 @@ contract BatchLockup_Gas_Test is Benchmark_Test { function gasCreateWithDurationsLT(uint256 batchSize, uint256 tranchesCount) internal { BatchLockup.CreateWithDurationsLT[] memory params = BatchLockupBuilder.fillBatch({ - batchSingle: defaults.createWithDurationsLT({ + params: defaults.createWithDurationsLT({ asset_: dai, totalAmount_: uint128(AMOUNT_PER_ITEM * tranchesCount), tranches_: _generateTranchesWithDuration(tranchesCount) @@ -174,7 +174,7 @@ contract BatchLockup_Gas_Test is Benchmark_Test { function gasCreateWithTimestampsLT(uint256 batchSize, uint256 tranchesCount) internal { BatchLockup.CreateWithTimestampsLT[] memory params = BatchLockupBuilder.fillBatch({ - batchSingle: defaults.createWithTimestampsLT({ + params: defaults.createWithTimestampsLT({ asset_: dai, totalAmount_: uint128(AMOUNT_PER_ITEM * tranchesCount), tranches_: _generateTranches(tranchesCount) diff --git a/benchmark/results/SablierV2BatchLockup.md b/benchmark/results/SablierV2BatchLockup.md index 2f6e56f3..799b0eec 100644 --- a/benchmark/results/SablierV2BatchLockup.md +++ b/benchmark/results/SablierV2BatchLockup.md @@ -2,33 +2,33 @@ | Function | Lockup Type | Segments/Tranches | Batch Size | Gas Usage | | ------------------------ | --------------- | ----------------- | ---------- | --------- | -| `createWithDurationsLL` | Lockup Linear | | 5 | 771013 | -| `createWithTimestampsLL` | Lockup Linear | | 5 | 732772 | +| `createWithDurationsLL` | Lockup Linear | N/A | 5 | 771013 | +| `createWithTimestampsLL` | Lockup Linear | N/A | 5 | 732772 | | `createWithDurationsLD` | Lockup Dynamic | 24 | 5 | 3951599 | | `createWithTimestampsLD` | Lockup Dynamic | 24 | 5 | 3815274 | -| `createWithDurationsLT` | Lockup Tranched | 24 | 5 | 3862661 | -| `createWithTimestampsLT` | Lockup Tranched | 24 | 5 | 3744535 | -| `createWithDurationsLL` | Lockup Linear | | 10 | 1417180 | -| `createWithTimestampsLL` | Lockup Linear | | 10 | 1414248 | -| `createWithDurationsLD` | Lockup Dynamic | 24 | 10 | 7819162 | -| `createWithTimestampsLD` | Lockup Dynamic | 24 | 10 | 7585613 | -| `createWithDurationsLT` | Lockup Tranched | 24 | 10 | 7632113 | -| `createWithTimestampsLT` | Lockup Tranched | 24 | 10 | 7444113 | -| `createWithDurationsLL` | Lockup Linear | | 20 | 2783509 | -| `createWithTimestampsLL` | Lockup Linear | | 20 | 2779081 | +| `createWithDurationsLT` | Lockup Tranched | 24 | 5 | 3862651 | +| `createWithTimestampsLT` | Lockup Tranched | 24 | 5 | 3744523 | +| `createWithDurationsLL` | Lockup Linear | N/A | 10 | 1417180 | +| `createWithTimestampsLL` | Lockup Linear | N/A | 10 | 1414247 | +| `createWithDurationsLD` | Lockup Dynamic | 24 | 10 | 7819165 | +| `createWithTimestampsLD` | Lockup Dynamic | 24 | 10 | 7585616 | +| `createWithDurationsLT` | Lockup Tranched | 24 | 10 | 7632114 | +| `createWithTimestampsLT` | Lockup Tranched | 24 | 10 | 7444115 | +| `createWithDurationsLL` | Lockup Linear | N/A | 20 | 2783510 | +| `createWithTimestampsLL` | Lockup Linear | N/A | 20 | 2779081 | | `createWithDurationsLD` | Lockup Dynamic | 24 | 20 | 15617207 | | `createWithTimestampsLD` | Lockup Dynamic | 24 | 20 | 15131248 | | `createWithDurationsLT` | Lockup Tranched | 24 | 20 | 15211892 | | `createWithTimestampsLT` | Lockup Tranched | 24 | 20 | 14846363 | -| `createWithDurationsLL` | Lockup Linear | | 30 | 4143337 | -| `createWithTimestampsLL` | Lockup Linear | | 30 | 4148585 | +| `createWithDurationsLL` | Lockup Linear | N/A | 30 | 4143337 | +| `createWithTimestampsLL` | Lockup Linear | N/A | 30 | 4148585 | | `createWithDurationsLD` | Lockup Dynamic | 24 | 30 | 23460912 | | `createWithTimestampsLD` | Lockup Dynamic | 24 | 30 | 22697560 | | `createWithDurationsLT` | Lockup Tranched | 24 | 30 | 22794686 | | `createWithTimestampsLT` | Lockup Tranched | 24 | 30 | 22267335 | -| `createWithDurationsLL` | Lockup Linear | | 50 | 6871104 | -| `createWithTimestampsLL` | Lockup Linear | | 50 | 6893873 | -| `createWithDurationsLD` | Lockup Dynamic | 12 | 50 | 22990717 | -| `createWithTimestampsLD` | Lockup Dynamic | 12 | 50 | 22355937 | -| `createWithDurationsLT` | Lockup Tranched | 12 | 50 | 22413551 | -| `createWithTimestampsLT` | Lockup Tranched | 12 | 50 | 22006164 | +| `createWithDurationsLL` | Lockup Linear | N/A | 50 | 6871104 | +| `createWithTimestampsLL` | Lockup Linear | N/A | 50 | 6893797 | +| `createWithDurationsLD` | Lockup Dynamic | 12 | 50 | 22990726 | +| `createWithTimestampsLD` | Lockup Dynamic | 12 | 50 | 22355943 | +| `createWithDurationsLT` | Lockup Tranched | 12 | 50 | 22413554 | +| `createWithTimestampsLT` | Lockup Tranched | 12 | 50 | 22006169 | diff --git a/bun.lockb b/bun.lockb index c142804b..e0520367 100755 Binary files a/bun.lockb and b/bun.lockb differ