diff --git a/.gas-snapshot b/.gas-snapshot index f208bfcdc..3bf29ee41 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,252 +1,234 @@ -Burn_Dynamic_Unit_Test:test_Burn_CallerApprovedOperator() (gas: 316441) -Burn_Dynamic_Unit_Test:test_Burn_CallerNFTOwner() (gas: 301441) -Burn_Linear_Unit_Test:test_Burn_CallerApprovedOperator() (gas: 238465) -Burn_Linear_Unit_Test:test_Burn_CallerNFTOwner() (gas: 216269) -CancelMultiple_Dynamic_Unit_Test:test_CancelMultiple_Recipient() (gas: 373569) -CancelMultiple_Dynamic_Unit_Test:test_CancelMultiple_Sender() (gas: 374046) -CancelMultiple_Linear_Unit_Test:test_CancelMultiple_Recipient() (gas: 260672) -CancelMultiple_Linear_Unit_Test:test_CancelMultiple_Sender() (gas: 261149) -Cancel_Dynamic_Fuzz_Test:testFuzz_Cancel_Recipient(uint256,uint128) (runs: 5000, μ: 349905, ~: 310519) -Cancel_Dynamic_Fuzz_Test:testFuzz_Cancel_Sender(uint256,uint128) (runs: 5000, μ: 380556, ~: 351180) -Cancel_Dynamic_Unit_Test:test_Cancel_Recipient() (gas: 358604) -Cancel_Dynamic_Unit_Test:test_Cancel_Recipient_SenderDoesNotImplementHook() (gas: 299456) -Cancel_Dynamic_Unit_Test:test_Cancel_Recipient_SenderNotContract() (gas: 52069) -Cancel_Dynamic_Unit_Test:test_Cancel_Recipient_SenderReentrancy() (gas: 300922) -Cancel_Dynamic_Unit_Test:test_Cancel_Recipient_SenderReverts() (gas: 299889) -Cancel_Dynamic_Unit_Test:test_Cancel_Sender() (gas: 376411) -Cancel_Dynamic_Unit_Test:test_Cancel_Sender_RecipientDoesNotImplementHook() (gas: 297299) -Cancel_Dynamic_Unit_Test:test_Cancel_Sender_RecipientNotContract() (gas: 57240) -Cancel_Dynamic_Unit_Test:test_Cancel_Sender_RecipientReentrancy() (gas: 298785) -Cancel_Dynamic_Unit_Test:test_Cancel_Sender_RecipientReverts() (gas: 297795) -Cancel_Linear_Fuzz_Test:testFuzz_Cancel_Recipient(uint256,uint128) (runs: 5000, μ: 242536, ~: 230744) -Cancel_Linear_Fuzz_Test:testFuzz_Cancel_Sender(uint256,uint128) (runs: 5000, μ: 273440, ~: 271374) -Cancel_Linear_Unit_Test:test_Cancel_Recipient() (gas: 239566) -Cancel_Linear_Unit_Test:test_Cancel_Recipient_SenderDoesNotImplementHook() (gas: 220887) -Cancel_Linear_Unit_Test:test_Cancel_Recipient_SenderNotContract() (gas: 44893) -Cancel_Linear_Unit_Test:test_Cancel_Recipient_SenderReentrancy() (gas: 222341) -Cancel_Linear_Unit_Test:test_Cancel_Recipient_SenderReverts() (gas: 221320) -Cancel_Linear_Unit_Test:test_Cancel_Sender() (gas: 257344) -Cancel_Linear_Unit_Test:test_Cancel_Sender_RecipientDoesNotImplementHook() (gas: 218703) -Cancel_Linear_Unit_Test:test_Cancel_Sender_RecipientNotContract() (gas: 50049) -Cancel_Linear_Unit_Test:test_Cancel_Sender_RecipientReentrancy() (gas: 220177) -Cancel_Linear_Unit_Test:test_Cancel_Sender_RecipientReverts() (gas: 219199) -ClaimProtocolRevenues_Dynamic_Unit_Test:test_ClaimProtocolRevenues() (gas: 309897) -ClaimProtocolRevenues_Linear_Unit_Test:test_ClaimProtocolRevenues() (gas: 233002) +Burn_Dynamic_Unit_Test:test_Burn_CallerApprovedOperator() (gas: 74934) +Burn_Dynamic_Unit_Test:test_Burn_CallerNFTOwner() (gas: 60043) +Burn_Linear_Unit_Test:test_Burn_CallerApprovedOperator() (gas: 77555) +Burn_Linear_Unit_Test:test_Burn_CallerNFTOwner() (gas: 63324) +CancelMultiple_Dynamic_Unit_Test:test_CancelMultiple_ArrayCountZero() (gas: 6304) +CancelMultiple_Dynamic_Unit_Test:test_CancelMultiple_CallerRecipient() (gas: 220579) +CancelMultiple_Dynamic_Unit_Test:test_CancelMultiple_CallerSender() (gas: 220989) +CancelMultiple_Linear_Unit_Test:test_CancelMultiple_ArrayCountZero() (gas: 6344) +CancelMultiple_Linear_Unit_Test:test_CancelMultiple_CallerRecipient() (gas: 159333) +CancelMultiple_Linear_Unit_Test:test_CancelMultiple_CallerSender() (gas: 159743) +Cancel_Dynamic_Fuzz_Test:testFuzz_Cancel_CallerRecipient(uint256,uint128) (runs: 5000, μ: 419545, ~: 423156) +Cancel_Dynamic_Fuzz_Test:testFuzz_Cancel_CallerSender(uint256,uint128) (runs: 5000, μ: 437093, ~: 441914) +Cancel_Dynamic_Unit_Test:test_Cancel_CallerRecipient() (gas: 376644) +Cancel_Dynamic_Unit_Test:test_Cancel_CallerRecipient_SenderDoesNotImplementHook() (gas: 366593) +Cancel_Dynamic_Unit_Test:test_Cancel_CallerRecipient_SenderNotContract() (gas: 89983) +Cancel_Dynamic_Unit_Test:test_Cancel_CallerRecipient_SenderReentrancy() (gas: 368039) +Cancel_Dynamic_Unit_Test:test_Cancel_CallerRecipient_SenderReverts() (gas: 367113) +Cancel_Dynamic_Unit_Test:test_Cancel_CallerSender() (gas: 372537) +Cancel_Dynamic_Unit_Test:test_Cancel_CallerSender_RecipientDoesNotImplementHook() (gas: 362429) +Cancel_Dynamic_Unit_Test:test_Cancel_CallerSender_RecipientNotContract() (gas: 92635) +Cancel_Dynamic_Unit_Test:test_Cancel_CallerSender_RecipientReentrancy() (gas: 363954) +Cancel_Dynamic_Unit_Test:test_Cancel_CallerSender_RecipientReverts() (gas: 363029) +Cancel_Dynamic_Unit_Test:test_Cancel_StreamingHasNotStarted() (gas: 69891) +Cancel_Linear_Fuzz_Test:testFuzz_Cancel_CallerRecipient(uint256,uint128) (runs: 5000, μ: 277757, ~: 278223) +Cancel_Linear_Fuzz_Test:testFuzz_Cancel_CallerSender(uint256,uint128) (runs: 5000, μ: 295164, ~: 296951) +Cancel_Linear_Unit_Test:test_Cancel_CallerRecipient() (gas: 259739) +Cancel_Linear_Unit_Test:test_Cancel_CallerRecipient_SenderDoesNotImplementHook() (gas: 249645) +Cancel_Linear_Unit_Test:test_Cancel_CallerRecipient_SenderNotContract() (gas: 73040) +Cancel_Linear_Unit_Test:test_Cancel_CallerRecipient_SenderReentrancy() (gas: 251101) +Cancel_Linear_Unit_Test:test_Cancel_CallerRecipient_SenderReverts() (gas: 250165) +Cancel_Linear_Unit_Test:test_Cancel_CallerSender() (gas: 255576) +Cancel_Linear_Unit_Test:test_Cancel_CallerSender_RecipientDoesNotImplementHook() (gas: 245439) +Cancel_Linear_Unit_Test:test_Cancel_CallerSender_RecipientNotContract() (gas: 75659) +Cancel_Linear_Unit_Test:test_Cancel_CallerSender_RecipientReentrancy() (gas: 246974) +Cancel_Linear_Unit_Test:test_Cancel_CallerSender_RecipientReverts() (gas: 246039) +Cancel_Linear_Unit_Test:test_Cancel_StreamingHasNotStarted() (gas: 72668) +ClaimProtocolRevenues_Dynamic_Unit_Test:test_ClaimProtocolRevenues() (gas: 310971) +ClaimProtocolRevenues_Linear_Unit_Test:test_ClaimProtocolRevenues() (gas: 235800) Constructor_Comptroller_Unit_Test:test_Constructor() (gas: 353541) -Constructor_Dynamic_Unit_Test:test_Constructor() (gas: 5451194) -Constructor_Linear_Unit_Test:test_Constructor() (gas: 4175136) -CreateWithDeltas_Dynamic_Fuzz_Test:testFuzz_CreateWithDeltas((uint128,uint64,uint40)[]) (runs: 5000, μ: 4774687, ~: 4702338) -CreateWithDeltas_Dynamic_Unit_Test:test_CreateWithDeltas() (gas: 363642) -CreateWithDurations_Linear_Fuzz_Test:testFuzz_CreateWithDurations((uint40,uint40)) (runs: 5000, μ: 267070, ~: 266781) -CreateWithDurations_Linear_Unit_Test:test_CreateWithDurations() (gas: 265827) -CreateWithMilestones_Dynamic_Fuzz_Test:testFuzz_CreateWithMilestones(address,((uint128,uint64,uint40)[],address,uint40,bool,address,uint128,address,(address,uint256)),uint256) (runs: 5000, μ: 4512647, ~: 4495522) -CreateWithMilestones_Dynamic_Unit_Test:test_CreateWithMilestones() (gas: 358971) -CreateWithMilestones_Dynamic_Unit_Test:test_CreateWithMilestones_AssetMissingReturnValue() (gas: 367887) -CreateWithRange_Linear_Fuzz_Test:testFuzz_CreateWithRange(address,(address,address,uint128,address,bool,(uint40,uint40,uint40),(address,uint256)),uint256) (runs: 5000, μ: 357825, ~: 355829) -CreateWithRange_Linear_Unit_Test:test_CreateWithRange() (gas: 263481) -CreateWithRange_Linear_Unit_Test:test_CreateWithRange_AssetMissingReturnValue() (gas: 272353) -FlashFee_Fuzz_Test:testFuzz_FlashFee(uint256,uint256) (runs: 5000, μ: 30997, ~: 31409) +Constructor_Dynamic_Unit_Test:test_Constructor() (gas: 5482223) +Constructor_Linear_Unit_Test:test_Constructor() (gas: 4239506) +CreateWithDeltas_Dynamic_Fuzz_Test:testFuzz_CreateWithDeltas((uint128,uint64,uint40)[]) (runs: 5000, μ: 4742850, ~: 4717044) +CreateWithDeltas_Dynamic_Unit_Test:test_CreateWithDeltas() (gas: 368442) +CreateWithDurations_Linear_Fuzz_Test:testFuzz_CreateWithDurations((uint40,uint40)) (runs: 5000, μ: 272932, ~: 273234) +CreateWithDurations_Linear_Unit_Test:test_CreateWithDurations() (gas: 271413) +CreateWithMilestones_Dynamic_Fuzz_Test:testFuzz_CreateWithMilestones(address,(address,uint40,bool,address,uint128,address,(address,uint256),(uint128,uint64,uint40)[]),uint256) (runs: 5000, μ: 4453994, ~: 4454006) +CreateWithMilestones_Dynamic_Unit_Test:test_CreateWithMilestones() (gas: 364477) +CreateWithMilestones_Dynamic_Unit_Test:test_CreateWithMilestones_AssetMissingReturnValue() (gas: 373419) +CreateWithRange_Linear_Fuzz_Test:testFuzz_CreateWithRange(address,(address,address,uint128,address,bool,(uint40,uint40,uint40),(address,uint256)),uint256) (runs: 5000, μ: 375439, ~: 383497) +CreateWithRange_Linear_Unit_Test:test_CreateWithRange() (gas: 269056) +CreateWithRange_Linear_Unit_Test:test_CreateWithRange_AssetMissingReturnValue() (gas: 277932) +FlashFee_Fuzz_Test:testFuzz_FlashFee(uint256,uint256) (runs: 5000, μ: 30380, ~: 30788) FlashFee_Unit_Test:test_FlashFee() (gas: 32342) -FlashFee_Unit_Test:test_FlashFee() (gas: 44194) +FlashFee_Unit_Test:test_FlashFee() (gas: 43455) FlashFee_Unit_Test:test_FlashFee_Zero() (gas: 7697) -FlashLoanFunction_Fuzz_Test:testFuzz_FlashLoanFunction(uint256,uint128,bytes) (runs: 5000, μ: 387549, ~: 389601) -FlashLoanFunction_Unit_Test:test_FlashLoan() (gas: 400344) -GetAsset_Dynamic_Unit_Test:test_GetAsset() (gas: 303432) -GetAsset_Dynamic_Unit_Test:test_GetAsset_StreamNull() (gas: 8835) -GetAsset_Linear_Unit_Test:test_GetAsset() (gas: 226523) -GetAsset_Linear_Unit_Test:test_GetAsset_StreamNull() (gas: 8802) -GetCliffTime_Linear_Unit_Test:test_GetCliffTime() (gas: 223928) -GetCliffTime_Linear_Unit_Test:test_GetCliffTime_StreamNull() (gas: 8209) -GetDepositAmount_Dynamic_Unit_Test:test_GetDepositAmount() (gas: 302464) -GetDepositAmount_Dynamic_Unit_Test:test_GetDepositAmount_StreamNull() (gas: 7867) -GetDepositAmount_Linear_Unit_Test:test_GetDepositAmount() (gas: 225577) -GetDepositAmount_Linear_Unit_Test:test_GetDepositAmount_StreamNull() (gas: 7856) -GetEndTime_Dynamic_Unit_Test:test_GetEndTime() (gas: 302903) -GetEndTime_Dynamic_Unit_Test:test_GetEndTime_StreamNull() (gas: 8351) -GetEndTime_Linear_Unit_Test:test_GetEndTime() (gas: 226038) -GetEndTime_Linear_Unit_Test:test_GetEndTime_StreamNull() (gas: 8362) -GetRange_Dynamic_Unit_Test:test_GetRange() (gas: 304031) -GetRange_Dynamic_Unit_Test:test_GetRange_StreamNull() (gas: 9339) -GetRange_Linear_Unit_Test:test_GetRange() (gas: 227624) -GetRange_Linear_Unit_Test:test_GetRange_StreamNull() (gas: 11797) -GetRecipient_Dynamic_Unit_Test:test_GetRecipient() (gas: 304896) -GetRecipient_Dynamic_Unit_Test:test_GetRecipient_StreamNull() (gas: 8197) -GetRecipient_Linear_Unit_Test:test_GetRecipient() (gas: 228031) -GetRecipient_Linear_Unit_Test:test_GetRecipient_StreamNull() (gas: 8208) -GetSegments_Dynamic_Unit_Test:test_GetSegments() (gas: 311843) -GetSegments_Dynamic_Unit_Test:test_GetSegments_StreamNull() (gas: 9879) -GetSender_Dynamic_Unit_Test:test_GetSender() (gas: 305320) -GetSender_Dynamic_Unit_Test:test_GetSender_StreamNull() (gas: 8577) -GetSender_Linear_Unit_Test:test_GetSender() (gas: 228411) -GetSender_Linear_Unit_Test:test_GetSender_StreamNull() (gas: 8544) -GetStartTime_Dynamic_Unit_Test:test_GetStartTime() (gas: 303123) -GetStartTime_Dynamic_Unit_Test:test_GetStartTime_StreamNull() (gas: 8550) -GetStartTime_Linear_Unit_Test:test_GetStartTime() (gas: 226214) -GetStartTime_Linear_Unit_Test:test_GetStartTime_StreamNull() (gas: 8517) -GetStatus_Dynamic_Unit_Test:test_GetStatus_Active() (gas: 324857) -GetStatus_Dynamic_Unit_Test:test_GetStatus_Canceled() (gas: 339515) -GetStatus_Dynamic_Unit_Test:test_GetStatus_Depleted() (gas: 351115) -GetStatus_Dynamic_Unit_Test:test_GetStatus_Null() (gas: 8125) -GetStatus_Linear_Unit_Test:test_GetStatus_Active() (gas: 247998) -GetStatus_Linear_Unit_Test:test_GetStatus_Canceled() (gas: 261448) -GetStatus_Linear_Unit_Test:test_GetStatus_Depleted() (gas: 273147) -GetStatus_Linear_Unit_Test:test_GetStatus_Null() (gas: 8142) -GetStream_Dynamic_Unit_Test:test_GetStream() (gas: 322365) -GetStream_Dynamic_Unit_Test:test_GetStream_StreamNull() (gas: 19766) -GetStream_Linear_Unit_Test:test_GetStream() (gas: 234640) -GetStream_Linear_Unit_Test:test_GetStream_StreamNull() (gas: 16453) -GetWithdrawnAmount_Dynamic_Fuzz_Test:testFuzz_GetWithdrawnAmount_NoWithdrawals(uint256) (runs: 5000, μ: 332884, ~: 333115) -GetWithdrawnAmount_Dynamic_Fuzz_Test:testFuzz_GetWithdrawnAmount_WithWithdrawals(uint256,uint128) (runs: 5000, μ: 379825, ~: 379839) -GetWithdrawnAmount_Dynamic_Unit_Test:test_GetWithdrawnAmount_NoWithdrawals() (gas: 328352) -GetWithdrawnAmount_Dynamic_Unit_Test:test_GetWithdrawnAmount_StreamNull() (gas: 8603) -GetWithdrawnAmount_Dynamic_Unit_Test:test_GetWithdrawnAmount_WithWithdrawals() (gas: 373074) -GetWithdrawnAmount_Linear_Fuzz_Test:testFuzz_GetWithdrawnAmount_NoWithdrawals(uint256) (runs: 5000, μ: 255985, ~: 256215) -GetWithdrawnAmount_Linear_Fuzz_Test:testFuzz_GetWithdrawnAmount_WithWithdrawals(uint256,uint128) (runs: 5000, μ: 274643, ~: 274477) -GetWithdrawnAmount_Linear_Unit_Test:test_GetWithdrawnAmount_NoWithdrawals() (gas: 251443) -GetWithdrawnAmount_Linear_Unit_Test:test_GetWithdrawnAmount_StreamNull() (gas: 8570) -GetWithdrawnAmount_Linear_Unit_Test:test_GetWithdrawnAmount_WithWithdrawals() (gas: 268045) -IsCancelable_Dynamic_Unit_Test:test_IsCancelable() (gas: 252577) -IsCancelable_Dynamic_Unit_Test:test_IsCancelable_CancelableStream() (gas: 10349) -IsCancelable_Dynamic_Unit_Test:test_IsCancelable_StreamCanceled() (gas: 51735) -IsCancelable_Dynamic_Unit_Test:test_IsCancelable_StreamDepleted() (gas: 61265) -IsCancelable_Dynamic_Unit_Test:test_IsCancelable_StreamNull() (gas: 8062) -IsCancelable_Linear_Unit_Test:test_IsCancelable() (gas: 175123) -IsCancelable_Linear_Unit_Test:test_IsCancelable_CancelableStream() (gas: 12339) -IsCancelable_Linear_Unit_Test:test_IsCancelable_StreamCanceled() (gas: 44517) -IsCancelable_Linear_Unit_Test:test_IsCancelable_StreamDepleted() (gas: 54146) -IsCancelable_Linear_Unit_Test:test_IsCancelable_StreamNull() (gas: 8052) -MaxFlashLoan_Fuzz_Test:testFuzz_MaxFlashLoan(uint256) (runs: 5000, μ: 155815, ~: 155819) -MaxFlashLoan_Unit_Test:test_MaxFlashLoan() (gas: 177352) -MaxFlashLoan_Unit_Test:test_MaxFlashLoan_AssetNotFlashLoanable() (gas: 13444) +FlashLoanFunction_Fuzz_Test:testFuzz_FlashLoanFunction(uint256,uint128,bytes) (runs: 5000, μ: 384568, ~: 387731) +FlashLoanFunction_Unit_Test:test_FlashLoan() (gas: 398011) +GetAsset_Dynamic_Unit_Test:test_GetAsset() (gas: 304800) +GetAsset_Linear_Unit_Test:test_GetAsset() (gas: 229605) +GetCliffTime_Linear_Unit_Test:test_GetCliffTime() (gas: 226960) +GetDepositedAmount_Dynamic_Unit_Test:test_GetDepositedAmount() (gas: 304387) +GetDepositedAmount_Linear_Unit_Test:test_GetDepositedAmount() (gas: 229236) +GetEndTime_Dynamic_Unit_Test:test_GetEndTime() (gas: 304221) +GetEndTime_Linear_Unit_Test:test_GetEndTime() (gas: 229098) +GetRange_Dynamic_Unit_Test:test_GetRange() (gas: 305390) +GetRange_Linear_Unit_Test:test_GetRange() (gas: 230700) +GetRecipient_Dynamic_Unit_Test:test_GetRecipient() (gas: 12624) +GetRecipient_Linear_Unit_Test:test_GetRecipient() (gas: 12641) +GetRefundedAmount_Dynamic_Unit_Test:test_GetRefundedAmount_StreamActive() (gas: 12914) +GetRefundedAmount_Dynamic_Unit_Test:test_GetRefundedAmount_StreamCanceled() (gas: 80057) +GetRefundedAmount_Dynamic_Unit_Test:test_GetRefundedAmount_StreamDepleted() (gas: 58023) +GetRefundedAmount_Linear_Unit_Test:test_GetRefundedAmount_StreamActive() (gas: 12899) +GetRefundedAmount_Linear_Unit_Test:test_GetRefundedAmount_StreamCanceled() (gas: 73419) +GetRefundedAmount_Linear_Unit_Test:test_GetRefundedAmount_StreamDepleted() (gas: 61264) +GetSegments_Dynamic_Unit_Test:test_GetSegments() (gas: 313189) +GetSender_Dynamic_Unit_Test:test_GetSender() (gas: 306660) +GetSender_Linear_Unit_Test:test_GetSender() (gas: 231487) +GetStartTime_Dynamic_Unit_Test:test_GetStartTime() (gas: 304486) +GetStartTime_Linear_Unit_Test:test_GetStartTime() (gas: 229313) +GetStatus_Dynamic_Unit_Test:test_GetStatus_Active() (gas: 325998) +GetStatus_Dynamic_Unit_Test:test_GetStatus_Canceled() (gas: 366303) +GetStatus_Dynamic_Unit_Test:test_GetStatus_Depleted() (gas: 352288) +GetStatus_Linear_Unit_Test:test_GetStatus_Active() (gas: 250847) +GetStatus_Linear_Unit_Test:test_GetStatus_Canceled() (gas: 287729) +GetStatus_Linear_Unit_Test:test_GetStatus_Depleted() (gas: 277593) +GetStream_Dynamic_Unit_Test:test_GetStream() (gas: 326198) +GetStream_Linear_Unit_Test:test_GetStream() (gas: 240275) +GetWithdrawnAmount_Dynamic_Fuzz_Test:testFuzz_GetWithdrawnAmount_NoWithdrawals(uint256) (runs: 5000, μ: 334295, ~: 334511) +GetWithdrawnAmount_Dynamic_Fuzz_Test:testFuzz_GetWithdrawnAmount_WithWithdrawals(uint256,uint128) (runs: 5000, μ: 380808, ~: 381660) +GetWithdrawnAmount_Dynamic_Unit_Test:test_GetWithdrawnAmount_NoWithdrawals() (gas: 329626) +GetWithdrawnAmount_Dynamic_Unit_Test:test_GetWithdrawnAmount_WithWithdrawals() (gas: 374696) +GetWithdrawnAmount_Linear_Fuzz_Test:testFuzz_GetWithdrawnAmount_NoWithdrawals(uint256) (runs: 5000, μ: 259114, ~: 259325) +GetWithdrawnAmount_Linear_Fuzz_Test:testFuzz_GetWithdrawnAmount_WithWithdrawals(uint256,uint128) (runs: 5000, μ: 278873, ~: 278885) +GetWithdrawnAmount_Linear_Unit_Test:test_GetWithdrawnAmount_NoWithdrawals() (gas: 254431) +GetWithdrawnAmount_Linear_Unit_Test:test_GetWithdrawnAmount_WithWithdrawals() (gas: 272069) +IsCancelable_Dynamic_Unit_Test:test_IsCancelable_StreamCancelable() (gas: 10241) +IsCancelable_Dynamic_Unit_Test:test_IsCancelable_StreamCanceled() (gas: 79437) +IsCancelable_Dynamic_Unit_Test:test_IsCancelable_StreamDepleted() (gas: 57422) +IsCancelable_Dynamic_Unit_Test:test_IsCancelable_StreamNotCancelable() (gas: 253605) +IsCancelable_Linear_Unit_Test:test_IsCancelable_StreamCancelable() (gas: 12248) +IsCancelable_Linear_Unit_Test:test_IsCancelable_StreamCanceled() (gas: 72821) +IsCancelable_Linear_Unit_Test:test_IsCancelable_StreamDepleted() (gas: 60685) +IsCancelable_Linear_Unit_Test:test_IsCancelable_StreamNotCancelable() (gas: 177922) +IsSettled_Dynamic_Unit_Test:test_IsSettled_RefundableAmountNotZero() (gas: 15721) +IsSettled_Dynamic_Unit_Test:test_IsSettled_RefundableAmountZero() (gas: 18565) +IsSettled_Dynamic_Unit_Test:test_IsSettled_StreamCanceled() (gas: 79628) +IsSettled_Dynamic_Unit_Test:test_IsSettled_StreamDepleted() (gas: 57689) +IsSettled_Linear_Unit_Test:test_IsSettled_RefundableAmountNotZero() (gas: 17741) +IsSettled_Linear_Unit_Test:test_IsSettled_RefundableAmountZero() (gas: 20711) +IsSettled_Linear_Unit_Test:test_IsSettled_StreamCanceled() (gas: 73044) +IsSettled_Linear_Unit_Test:test_IsSettled_StreamDepleted() (gas: 60984) +MaxFlashLoan_Fuzz_Test:testFuzz_MaxFlashLoan(uint256) (runs: 5000, μ: 155504, ~: 155505) +MaxFlashLoan_Unit_Test:test_MaxFlashLoan() (gas: 177044) +MaxFlashLoan_Unit_Test:test_MaxFlashLoan_AssetNotFlashLoanable() (gas: 13100) ProtocolFees_Unit_Test:test_ProtocolFees() (gas: 32992) ProtocolFees_Unit_Test:test_ProtocolFees_ProtocolFeeNotSet() (gas: 7795) -ProtocolRevenues_Dynamic_Unit_Test:test_ProtocolRevenues() (gas: 310741) -ProtocolRevenues_Dynamic_Unit_Test:test_ProtocolRevenues_ProtocolRevenuesZero() (gas: 7961) -ProtocolRevenues_Linear_Unit_Test:test_ProtocolRevenues() (gas: 233854) -ProtocolRevenues_Linear_Unit_Test:test_ProtocolRevenues_ProtocolRevenuesZero() (gas: 7950) -Renounce_Dynamic_Unit_Test:test_Renounce() (gas: 283929) -Renounce_Dynamic_Unit_Test:test_Renounce_RecipientDoesNotImplementHook() (gas: 282033) -Renounce_Dynamic_Unit_Test:test_Renounce_RecipientNotContract() (gas: 21610) -Renounce_Dynamic_Unit_Test:test_Renounce_RecipientReentrancy() (gas: 283877) -Renounce_Dynamic_Unit_Test:test_Renounce_RecipientReverts() (gas: 282353) -Renounce_Linear_Unit_Test:test_Renounce() (gas: 206507) -Renounce_Linear_Unit_Test:test_Renounce_RecipientDoesNotImplementHook() (gas: 204595) -Renounce_Linear_Unit_Test:test_Renounce_RecipientNotContract() (gas: 23652) -Renounce_Linear_Unit_Test:test_Renounce_RecipientReentrancy() (gas: 206487) -Renounce_Linear_Unit_Test:test_Renounce_RecipientReverts() (gas: 204915) -RefundableAmountOf_Dynamic_Fuzz_Test:testFuzz_RefundableAmountOf(uint256) (runs: 5000, μ: 349188, ~: 360467) -RefundableAmountOf_Dynamic_Unit_Test:test_RefundableAmountOf() (gas: 51821) -RefundableAmountOf_Dynamic_Unit_Test:test_RefundableAmountOf_StreamCanceled() (gas: 51502) -RefundableAmountOf_Dynamic_Unit_Test:test_RefundableAmountOf_StreamDepleted() (gas: 61019) -RefundableAmountOf_Dynamic_Unit_Test:test_RefundableAmountOf_StreamNull() (gas: 7804) -RefundableAmountOf_Linear_Fuzz_Test:testFuzz_RefundableAmountOf(uint256) (runs: 5000, μ: 258246, ~: 258359) -RefundableAmountOf_Linear_Unit_Test:test_RefundableAmountOf() (gas: 20781) -RefundableAmountOf_Linear_Unit_Test:test_RefundableAmountOf_StreamCanceled() (gas: 44284) -RefundableAmountOf_Linear_Unit_Test:test_RefundableAmountOf_StreamDepleted() (gas: 53900) -RefundableAmountOf_Linear_Unit_Test:test_RefundableAmountOf_StreamNull() (gas: 7794) -SetComptroller_Dynamic_Unit_Test:test_SetComptroller_NewComptroller() (gas: 371796) -SetComptroller_Dynamic_Unit_Test:test_SetComptroller_SameComptroller() (gas: 23402) -SetComptroller_Linear_Unit_Test:test_SetComptroller_NewComptroller() (gas: 371809) -SetComptroller_Linear_Unit_Test:test_SetComptroller_SameComptroller() (gas: 23415) -SetFlashFee_Fuzz_Test:testFuzz_SetFlashFee(uint256) (runs: 5000, μ: 42802, ~: 43783) +ProtocolRevenues_Dynamic_Unit_Test:test_ProtocolRevenues() (gas: 311888) +ProtocolRevenues_Dynamic_Unit_Test:test_ProtocolRevenues_ProtocolRevenuesZero() (gas: 7939) +ProtocolRevenues_Linear_Unit_Test:test_ProtocolRevenues() (gas: 236703) +ProtocolRevenues_Linear_Unit_Test:test_ProtocolRevenues_ProtocolRevenuesZero() (gas: 7934) +RefundableAmountOf_Dynamic_Fuzz_Test:testFuzz_RefundableAmountOf(uint256) (runs: 5000, μ: 352093, ~: 364612) +RefundableAmountOf_Dynamic_Unit_Test:test_RefundableAmountOf() (gas: 57202) +RefundableAmountOf_Dynamic_Unit_Test:test_RefundableAmountOf_StreamCanceled() (gas: 79259) +RefundableAmountOf_Dynamic_Unit_Test:test_RefundableAmountOf_StreamDepleted() (gas: 57320) +RefundableAmountOf_Linear_Fuzz_Test:testFuzz_RefundableAmountOf(uint256) (runs: 5000, μ: 262416, ~: 262497) +RefundableAmountOf_Linear_Unit_Test:test_RefundableAmountOf() (gas: 23712) +RefundableAmountOf_Linear_Unit_Test:test_RefundableAmountOf_StreamCanceled() (gas: 72631) +RefundableAmountOf_Linear_Unit_Test:test_RefundableAmountOf_StreamDepleted() (gas: 60571) +Renounce_Dynamic_Unit_Test:test_Renounce() (gas: 286964) +Renounce_Dynamic_Unit_Test:test_Renounce_RecipientDoesNotImplementHook() (gas: 284971) +Renounce_Dynamic_Unit_Test:test_Renounce_RecipientNotContract() (gas: 21289) +Renounce_Dynamic_Unit_Test:test_Renounce_RecipientReentrancy() (gas: 286860) +Renounce_Dynamic_Unit_Test:test_Renounce_RecipientReverts() (gas: 285386) +Renounce_Linear_Unit_Test:test_Renounce() (gas: 211352) +Renounce_Linear_Unit_Test:test_Renounce_RecipientDoesNotImplementHook() (gas: 209342) +Renounce_Linear_Unit_Test:test_Renounce_RecipientNotContract() (gas: 23362) +Renounce_Linear_Unit_Test:test_Renounce_RecipientReentrancy() (gas: 211282) +Renounce_Linear_Unit_Test:test_Renounce_RecipientReverts() (gas: 209757) +SetComptroller_Dynamic_Unit_Test:test_SetComptroller_NewComptroller() (gas: 371685) +SetComptroller_Dynamic_Unit_Test:test_SetComptroller_SameComptroller() (gas: 23291) +SetComptroller_Linear_Unit_Test:test_SetComptroller_NewComptroller() (gas: 371742) +SetComptroller_Linear_Unit_Test:test_SetComptroller_SameComptroller() (gas: 23348) +SetFlashFee_Fuzz_Test:testFuzz_SetFlashFee(uint256) (runs: 5000, μ: 42731, ~: 43783) SetFlashFee_Unit_Test:test_SetFlashFee() (gas: 39154) -SetFlashFee_Unit_Test:test_SetFlashFee_SameFee() (gas: 12446) -SetNFTDescriptor_Dynamic_Unit_Test:test_SetNFTDescriptor_NewNFTDescriptor() (gas: 206053) -SetNFTDescriptor_Dynamic_Unit_Test:test_SetNFTDescriptor_SameNFTDescriptor() (gas: 34347) -SetNFTDescriptor_Linear_Unit_Test:test_SetNFTDescriptor_NewNFTDescriptor() (gas: 206014) -SetNFTDescriptor_Linear_Unit_Test:test_SetNFTDescriptor_SameNFTDescriptor() (gas: 34308) -SetProtocolFee_Fuzz_Test:testFuzz_SetProtocolFee(uint256) (runs: 5000, μ: 44580, ~: 44786) +SetFlashFee_Unit_Test:test_SetFlashFee_SameFee() (gas: 21933) +SetNFTDescriptor_Dynamic_Unit_Test:test_SetNFTDescriptor_NewNFTDescriptor() (gas: 210287) +SetNFTDescriptor_Dynamic_Unit_Test:test_SetNFTDescriptor_SameNFTDescriptor() (gas: 38581) +SetNFTDescriptor_Linear_Unit_Test:test_SetNFTDescriptor_NewNFTDescriptor() (gas: 210317) +SetNFTDescriptor_Linear_Unit_Test:test_SetNFTDescriptor_SameNFTDescriptor() (gas: 38611) +SetProtocolFee_Fuzz_Test:testFuzz_SetProtocolFee(uint256) (runs: 5000, μ: 44628, ~: 44786) SetProtocolFee_Unit_Test:test_SetProtocolFee() (gas: 40201) -SetProtocolFee_Unit_Test:test_SetProtocolFee_SameFee() (gas: 13084) -StreamedAmountOf_Dynamic_Fuzz_Test:testFuzz_StreamedAmountOf_CurrentMilestoneNot1st(uint40) (runs: 5000, μ: 28571536, ~: 28414174) -StreamedAmountOf_Dynamic_Fuzz_Test:testFuzz_StreamedAmountOf_OneSegment(uint40) (runs: 5000, μ: 505721, ~: 497447) -StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_CurrentMilestone1st() (gas: 30815) -StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_CurrentMilestoneNot1st() (gas: 38366) -StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_OneSegment() (gas: 245383) -StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_StartTimeEqualToCurrentTime() (gas: 13273) -StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_StartTimeGreaterThanCurrentTime() (gas: 13300) -StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_StreamCanceled() (gas: 55877) -StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_StreamDepleted() (gas: 62627) -StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_StreamNull() (gas: 10264) -StreamedAmountOf_Linear_Fuzz_Test:testFuzz_StreamedAmountOf(uint40,uint128) (runs: 5000, μ: 404276, ~: 403972) -StreamedAmountOf_Linear_Fuzz_Test:testFuzz_StreamedAmountOf_CliffTimeGreaterThanCurrentTime(uint40) (runs: 5000, μ: 253856, ~: 254108) -StreamedAmountOf_Linear_Unit_Test:test_StreamedAmountOf() (gas: 18178) -StreamedAmountOf_Linear_Unit_Test:test_StreamedAmountOf_CliffTimeGreaterThanCurrentTime() (gas: 12376) -StreamedAmountOf_Linear_Unit_Test:test_StreamedAmountOf_StreamCanceled() (gas: 48626) -StreamedAmountOf_Linear_Unit_Test:test_StreamedAmountOf_StreamDepleted() (gas: 55531) -StreamedAmountOf_Linear_Unit_Test:test_StreamedAmountOf_StreamNull() (gas: 10254) +SetProtocolFee_Unit_Test:test_SetProtocolFee_SameFee() (gas: 20258) +StreamedAmountOf_Dynamic_Fuzz_Test:testFuzz_StreamedAmountOf_Calculation((uint128,uint64,uint40)[],uint40) (runs: 5000, μ: 4123331, ~: 4115864) +StreamedAmountOf_Dynamic_Fuzz_Test:testFuzz_StreamedAmountOf_Monotonicity((uint128,uint64,uint40)[],uint40,uint40) (runs: 5000, μ: 4200914, ~: 4163953) +StreamedAmountOf_Dynamic_Fuzz_Test:testFuzz_StreamedAmountOf_OneSegment((uint128,uint64,uint40),uint40) (runs: 5000, μ: 299327, ~: 295319) +StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_CurrentMilestone1st() (gas: 40272) +StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_CurrentMilestoneNot1st() (gas: 44991) +StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_OneSegment() (gas: 247629) +StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_StartTimeInTheFuture() (gas: 17945) +StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_StartTimeInThePresent() (gas: 18006) +StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_StreamCanceled() (gas: 82238) +StreamedAmountOf_Dynamic_Unit_Test:test_StreamedAmountOf_StreamDepleted() (gas: 58604) +StreamedAmountOf_Linear_Fuzz_Test:testFuzz_StreamedAmountOf_Calculation(uint40,uint128) (runs: 5000, μ: 225103, ~: 224901) +StreamedAmountOf_Linear_Fuzz_Test:testFuzz_StreamedAmountOf_CliffTimeInTheFuture(uint40) (runs: 5000, μ: 24748, ~: 24989) +StreamedAmountOf_Linear_Fuzz_Test:testFuzz_StreamedAmountOf_Monotonicity(uint40,uint40,uint128) (runs: 5000, μ: 235491, ~: 236467) +StreamedAmountOf_Linear_Unit_Test:test_StreamedAmountOf() (gas: 20491) +StreamedAmountOf_Linear_Unit_Test:test_StreamedAmountOf_CliffTimeInTheFuture() (gas: 17090) +StreamedAmountOf_Linear_Unit_Test:test_StreamedAmountOf_StreamCanceled() (gas: 75575) +StreamedAmountOf_Linear_Unit_Test:test_StreamedAmountOf_StreamDepleted() (gas: 61786) ToggleFlashAsset_Unit_Test:test_ToggleFlashAsset() (gas: 29841) ToggleFlashAsset_Unit_Test:test_ToggleFlashAsset_FlagNotEnabled() (gas: 39493) -TokenURI_Dynamic_Unit_Test:test_TokenURI() (gas: 318733) -TokenURI_Dynamic_Unit_Test:test_TokenURI_StreamNull() (gas: 22154) -TokenURI_Linear_Unit_Test:test_TokenURI() (gas: 241787) -TokenURI_Linear_Unit_Test:test_TokenURI_StreamNull() (gas: 22063) -TransferAdmin_Fuzz_Test:testFuzz_TransferAdmin(address) (runs: 5000, μ: 21832, ~: 21832) -TransferAdmin_Unit_Test:test_TransferAdmin_NewAdmin() (gas: 23479) -TransferAdmin_Unit_Test:test_TransferAdmin_SameAdmin() (gas: 18572) -TransferAdmin_Unit_Test:test_TransferAdmin_ZeroAddress() (gas: 16354) -WithdrawMax_Dynamic_Fuzz_Test:testFuzz_WithdrawMax(uint256) (runs: 5000, μ: 105929, ~: 109589) -WithdrawMax_Dynamic_Unit_Test:test_WithdrawMax() (gas: 106180) -WithdrawMax_Dynamic_Unit_Test:test_WithdrawMax_CurrentTimeEqualToEndTime() (gas: 60612) -WithdrawMax_Linear_Fuzz_Test:testFuzz_WithdrawMax(uint256) (runs: 5000, μ: 61579, ~: 61691) -WithdrawMax_Linear_Unit_Test:test_WithdrawMax() (gas: 58536) -WithdrawMax_Linear_Unit_Test:test_WithdrawMax_CurrentTimeEqualToEndTime() (gas: 53526) -WithdrawMultiple_Dynamic_Fuzz_Test:testFuzz_WithdrawMultiple_AllStreamsEnded(uint256,address) (runs: 5000, μ: 133159, ~: 133343) -WithdrawMultiple_Dynamic_Fuzz_Test:testFuzz_WithdrawMultiple_AllStreamsOngoing(uint256,address,uint128) (runs: 5000, μ: 167084, ~: 168252) -WithdrawMultiple_Dynamic_Fuzz_Test:testFuzz_WithdrawMultiple_CallerApprovedOperator(address) (runs: 5000, μ: 171162, ~: 171169) -WithdrawMultiple_Dynamic_Fuzz_Test:testFuzz_WithdrawMultiple_SomeStreamsEndedSomeStreamsOngoing((uint128,uint256,address)) (runs: 5000, μ: 378746, ~: 378766) -WithdrawMultiple_Dynamic_Unit_Test:test_WithdrawMultiple_AllStreamsEnded() (gas: 113056) -WithdrawMultiple_Dynamic_Unit_Test:test_WithdrawMultiple_AllStreamsOngoing() (gas: 145202) -WithdrawMultiple_Dynamic_Unit_Test:test_WithdrawMultiple_CallerApprovedOperator() (gas: 155900) -WithdrawMultiple_Dynamic_Unit_Test:test_WithdrawMultiple_SomeStreamsEndedSomeStreamsOngoing() (gas: 356501) -WithdrawMultiple_Linear_Fuzz_Test:testFuzz_WithdrawMultiple_AllStreamsEnded(uint256,address) (runs: 5000, μ: 118896, ~: 119099) -WithdrawMultiple_Linear_Fuzz_Test:testFuzz_WithdrawMultiple_AllStreamsOngoing(uint256,address,uint128) (runs: 5000, μ: 113262, ~: 113126) -WithdrawMultiple_Linear_Fuzz_Test:testFuzz_WithdrawMultiple_CallerApprovedOperator(address) (runs: 5000, μ: 129826, ~: 129843) -WithdrawMultiple_Linear_Fuzz_Test:testFuzz_WithdrawMultiple_SomeStreamsEndedSomeStreamsOngoing((uint128,uint256,address)) (runs: 5000, μ: 266006, ~: 265827) -WithdrawMultiple_Linear_Unit_Test:test_WithdrawMultiple_AllStreamsEnded() (gas: 98812) -WithdrawMultiple_Linear_Unit_Test:test_WithdrawMultiple_AllStreamsOngoing() (gas: 90401) -WithdrawMultiple_Linear_Unit_Test:test_WithdrawMultiple_CallerApprovedOperator() (gas: 114574) -WithdrawMultiple_Linear_Unit_Test:test_WithdrawMultiple_SomeStreamsEndedSomeStreamsOngoing() (gas: 243623) -Withdraw_Dynamic_Fuzz_Test:testFuzz_Withdraw(uint256,uint128) (runs: 5000, μ: 342276, ~: 331499) -Withdraw_Dynamic_Fuzz_Test:testFuzz_Withdraw_CallerApprovedOperator(address) (runs: 5000, μ: 118012, ~: 118023) -Withdraw_Dynamic_Fuzz_Test:testFuzz_Withdraw_CallerRecipient(address) (runs: 5000, μ: 86581, ~: 86588) -Withdraw_Dynamic_Fuzz_Test:testFuzz_Withdraw_RecipientNotContract(uint256,address,uint128) (runs: 5000, μ: 355500, ~: 356283) -Withdraw_Dynamic_Fuzz_Test:test_Withdraw_FuzzedSegments((uint128,(uint128,uint64,uint40)[],uint256)) (runs: 5000, μ: 4147004, ~: 4171767) -Withdraw_Dynamic_Unit_Test:test_Withdraw() (gas: 352785) -Withdraw_Dynamic_Unit_Test:test_Withdraw_CallerApprovedOperator() (gas: 102509) -Withdraw_Dynamic_Unit_Test:test_Withdraw_CallerRecipient() (gas: 71061) -Withdraw_Dynamic_Unit_Test:test_Withdraw_CurrentTimeEqualToEndTime() (gas: 65195) -Withdraw_Dynamic_Unit_Test:test_Withdraw_RecipientDoesNotImplementHook() (gas: 332467) -Withdraw_Dynamic_Unit_Test:test_Withdraw_RecipientNotContract() (gas: 96417) -Withdraw_Dynamic_Unit_Test:test_Withdraw_RecipientReentrancy() (gas: 359641) -Withdraw_Dynamic_Unit_Test:test_Withdraw_RecipientReverts() (gas: 333033) -Withdraw_Linear_Fuzz_Test:testFuzz_Withdraw(uint256,uint128) (runs: 5000, μ: 252617, ~: 252633) -Withdraw_Linear_Fuzz_Test:testFuzz_Withdraw_CallerApprovedOperator(address) (runs: 5000, μ: 97363, ~: 97374) -Withdraw_Linear_Fuzz_Test:testFuzz_Withdraw_CallerRecipient(address) (runs: 5000, μ: 65938, ~: 65950) -Withdraw_Linear_Fuzz_Test:testFuzz_Withdraw_RecipientNotContract(uint256,address,uint128) (runs: 5000, μ: 250372, ~: 250186) -Withdraw_Linear_Unit_Test:test_Withdraw() (gas: 247314) -Withdraw_Linear_Unit_Test:test_Withdraw_CallerApprovedOperator() (gas: 81921) -Withdraw_Linear_Unit_Test:test_Withdraw_CallerRecipient() (gas: 50484) -Withdraw_Linear_Unit_Test:test_Withdraw_CurrentTimeEqualToEndTime() (gas: 58132) -Withdraw_Linear_Unit_Test:test_Withdraw_RecipientDoesNotImplementHook() (gas: 240449) -Withdraw_Linear_Unit_Test:test_Withdraw_RecipientNotContract() (gas: 62365) -Withdraw_Linear_Unit_Test:test_Withdraw_RecipientReentrancy() (gas: 253062) -Withdraw_Linear_Unit_Test:test_Withdraw_RecipientReverts() (gas: 241015) -WithdrawableAmountOf_Dynamic_Fuzz_Test:testFuzz_WithdrawableAmountOf(uint40,uint128) (runs: 5000, μ: 572351, ~: 556575) -WithdrawableAmountOf_Dynamic_Fuzz_Test:testFuzz_WithdrawableAmountOf_WithoutWithdrawals(uint40) (runs: 5000, μ: 541568, ~: 532103) -WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf() (gas: 296454) -WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf_StartTimeEqualToCurrentTime() (gas: 258416) -WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf_StartTimeGreaterThanCurrentTime() (gas: 258377) -WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf_StreamCanceled() (gas: 61268) -WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf_StreamDepleted() (gas: 70798) -WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf_StreamNull() (gas: 11076) -WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf_WithoutWithdrawals() (gas: 268735) -WithdrawableAmountOf_Linear_Fuzz_Test:testFuzz_WithdrawableAmountOf_CliffTimeGreaterThanCurrentTime(uint40) (runs: 5000, μ: 254750, ~: 255001) -WithdrawableAmountOf_Linear_Fuzz_Test:testFuzz_WithdrawableAmountOf_NoWithdrawals(uint40,uint128) (runs: 5000, μ: 405270, ~: 404947) -WithdrawableAmountOf_Linear_Fuzz_Test:testFuzz_WithdrawableAmountOf_WithWithdrawals(uint40,uint128,uint128) (runs: 5000, μ: 429797, ~: 429746) -WithdrawableAmountOf_Linear_Unit_Test:test_WithdrawableAmountOf_CliffTimeGreaterThanCurrentTime() (gas: 178608) -WithdrawableAmountOf_Linear_Unit_Test:test_WithdrawableAmountOf_NoWithdrawals() (gas: 182410) -WithdrawableAmountOf_Linear_Unit_Test:test_WithdrawableAmountOf_StreamCanceled() (gas: 47582) -WithdrawableAmountOf_Linear_Unit_Test:test_WithdrawableAmountOf_StreamDepleted() (gas: 57166) -WithdrawableAmountOf_Linear_Unit_Test:test_WithdrawableAmountOf_StreamNull() (gas: 11121) -WithdrawableAmountOf_Linear_Unit_Test:test_WithdrawableAmountOf_WithWithdrawals() (gas: 203967) +TokenURI_Dynamic_Unit_Test:test_TokenURI() (gas: 319987) +TokenURI_Linear_Unit_Test:test_TokenURI() (gas: 244835) +TransferAdmin_Fuzz_Test:testFuzz_TransferAdmin(address) (runs: 5000, μ: 21572, ~: 21573) +TransferAdmin_Unit_Test:test_TransferAdmin_NewAdmin() (gas: 23411) +TransferAdmin_Unit_Test:test_TransferAdmin_SameAdmin() (gas: 18504) +TransferAdmin_Unit_Test:test_TransferAdmin_ZeroAddress() (gas: 16286) +WithdrawMax_Dynamic_Fuzz_Test:testFuzz_WithdrawMax(uint256) (runs: 5000, μ: 110630, ~: 113308) +WithdrawMax_Dynamic_Unit_Test:test_WithdrawMax() (gas: 109731) +WithdrawMax_Dynamic_Unit_Test:test_WithdrawMax_EndTimeInThePast() (gas: 64037) +WithdrawMax_Linear_Fuzz_Test:testFuzz_WithdrawMax(uint256) (runs: 5000, μ: 65723, ~: 65822) +WithdrawMax_Linear_Unit_Test:test_WithdrawMax() (gas: 62520) +WithdrawMax_Linear_Unit_Test:test_WithdrawMax_EndTimeInThePast() (gas: 67331) +WithdrawMultiple_Dynamic_Fuzz_Test:testFuzz_WithdrawMultiple(uint256,address,uint128) (runs: 5000, μ: 377613, ~: 377708) +WithdrawMultiple_Dynamic_Fuzz_Test:testFuzz_WithdrawMultiple_CallerApprovedOperator(address) (runs: 5000, μ: 174852, ~: 174864) +WithdrawMultiple_Dynamic_Unit_Test:test_WithdrawMultiple_ArrayCountsZero() (gas: 9169) +WithdrawMultiple_Dynamic_Unit_Test:test_WithdrawMultiple_CallerApprovedOperator() (gas: 194169) +WithdrawMultiple_Linear_Fuzz_Test:testFuzz_WithdrawMultiple(uint256,address,uint128) (runs: 5000, μ: 278005, ~: 277985) +WithdrawMultiple_Linear_Fuzz_Test:testFuzz_WithdrawMultiple_CallerApprovedOperator(address) (runs: 5000, μ: 135529, ~: 135543) +WithdrawMultiple_Linear_Unit_Test:test_WithdrawMultiple_ArrayCountsZero() (gas: 9180) +WithdrawMultiple_Linear_Unit_Test:test_WithdrawMultiple_CallerApprovedOperator() (gas: 157899) +Withdraw_Dynamic_Fuzz_Test:testFuzz_Withdraw(uint256,address,uint128) (runs: 5000, μ: 99449, ~: 86202) +Withdraw_Dynamic_Fuzz_Test:testFuzz_Withdraw_CallerApprovedOperator(address) (runs: 5000, μ: 119747, ~: 119751) +Withdraw_Dynamic_Fuzz_Test:testFuzz_Withdraw_CallerRecipient(address) (runs: 5000, μ: 88385, ~: 88394) +Withdraw_Dynamic_Fuzz_Test:testFuzz_Withdraw_StreamCanceled(uint256,address,uint128) (runs: 5000, μ: 148569, ~: 149343) +Withdraw_Dynamic_Fuzz_Test:test_Withdraw_FuzzedSegments(((uint128,uint64,uint40)[],uint256,address)) (runs: 5000, μ: 4175274, ~: 4107324) +Withdraw_Dynamic_Unit_Test:test_Withdraw_CallerApprovedOperator() (gas: 104256) +Withdraw_Dynamic_Unit_Test:test_Withdraw_CallerRecipient() (gas: 72853) +Withdraw_Dynamic_Unit_Test:test_Withdraw_EndTimeInThePresent() (gas: 62210) +Withdraw_Dynamic_Unit_Test:test_Withdraw_RecipientDoesNotImplementHook() (gas: 333430) +Withdraw_Dynamic_Unit_Test:test_Withdraw_RecipientNotContract() (gas: 98482) +Withdraw_Dynamic_Unit_Test:test_Withdraw_RecipientReentrancy() (gas: 360286) +Withdraw_Dynamic_Unit_Test:test_Withdraw_RecipientReverts() (gas: 334018) +Withdraw_Dynamic_Unit_Test:test_Withdraw_StreamActive() (gas: 353962) +Withdraw_Dynamic_Unit_Test:test_Withdraw_StreamCanceled() (gas: 369626) +Withdraw_Linear_Fuzz_Test:testFuzz_Withdraw(uint256,address,uint128) (runs: 5000, μ: 86322, ~: 86327) +Withdraw_Linear_Fuzz_Test:testFuzz_Withdraw_CallerApprovedOperator(address) (runs: 5000, μ: 100033, ~: 100037) +Withdraw_Linear_Fuzz_Test:testFuzz_Withdraw_CallerRecipient(address) (runs: 5000, μ: 68611, ~: 68618) +Withdraw_Linear_Fuzz_Test:testFuzz_Withdraw_StreamCanceled(uint256,address,uint128) (runs: 5000, μ: 132241, ~: 132237) +Withdraw_Linear_Unit_Test:test_Withdraw_CallerApprovedOperator() (gas: 84580) +Withdraw_Linear_Unit_Test:test_Withdraw_CallerRecipient() (gas: 53182) +Withdraw_Linear_Unit_Test:test_Withdraw_EndTimeInThePresent() (gas: 65445) +Withdraw_Linear_Unit_Test:test_Withdraw_RecipientDoesNotImplementHook() (gas: 244021) +Withdraw_Linear_Unit_Test:test_Withdraw_RecipientNotContract() (gas: 65064) +Withdraw_Linear_Unit_Test:test_Withdraw_RecipientReentrancy() (gas: 257192) +Withdraw_Linear_Unit_Test:test_Withdraw_RecipientReverts() (gas: 244609) +Withdraw_Linear_Unit_Test:test_Withdraw_StreamActive() (gas: 250816) +Withdraw_Linear_Unit_Test:test_Withdraw_StreamCanceled() (gas: 280338) +WithdrawableAmountOf_Dynamic_Fuzz_Test:testFuzz_WithdrawableAmountOf(uint40,uint128) (runs: 5000, μ: 575108, ~: 559167) +WithdrawableAmountOf_Dynamic_Fuzz_Test:testFuzz_WithdrawableAmountOf_WithoutWithdrawals(uint40) (runs: 5000, μ: 544587, ~: 535217) +WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf() (gas: 298428) +WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf_StartTimeInTheFuture() (gas: 260605) +WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf_StartTimeInThePresent() (gas: 260601) +WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf_StreamCanceled() (gas: 83433) +WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf_StreamDepleted() (gas: 60212) +WithdrawableAmountOf_Dynamic_Unit_Test:test_WithdrawableAmountOf_WithoutWithdrawals() (gas: 270963) +WithdrawableAmountOf_Linear_Fuzz_Test:testFuzz_WithdrawableAmountOf_CliffTimeInTheFuture(uint40) (runs: 5000, μ: 258567, ~: 258803) +WithdrawableAmountOf_Linear_Fuzz_Test:testFuzz_WithdrawableAmountOf_NoWithdrawals(uint40,uint128) (runs: 5000, μ: 411749, ~: 411481) +WithdrawableAmountOf_Linear_Fuzz_Test:testFuzz_WithdrawableAmountOf_WithWithdrawals(uint40,uint128,uint128) (runs: 5000, μ: 436863, ~: 436843) +WithdrawableAmountOf_Linear_Unit_Test:test_WithdrawableAmountOf_CliffTimeInTheFuture() (gas: 182480) +WithdrawableAmountOf_Linear_Unit_Test:test_WithdrawableAmountOf_NoWithdrawals() (gas: 185926) +WithdrawableAmountOf_Linear_Unit_Test:test_WithdrawableAmountOf_StreamCanceled() (gas: 76780) +WithdrawableAmountOf_Linear_Unit_Test:test_WithdrawableAmountOf_StreamDepleted() (gas: 63418) +WithdrawableAmountOf_Linear_Unit_Test:test_WithdrawableAmountOf_WithWithdrawals() (gas: 208102) \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index b1bf5359e..73de0c055 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,7 +15,7 @@ path = "lib/prb-contracts" url = "https://github.com/PaulRBerg/prb-contracts" [submodule "lib/prb-math"] - branch = "v3" + branch = "v4" path = "lib/prb-math" url = "https://github.com/PaulRBerg/prb-math" [submodule "lib/prb-test"] diff --git a/.solhint.json b/.solhint.json index 65229ee77..22cafb398 100644 --- a/.solhint.json +++ b/.solhint.json @@ -3,7 +3,7 @@ "rules": { "avoid-low-level-calls": "off", "code-complexity": ["error", 9], - "compiler-version": ["error", ">=0.8.13"], + "compiler-version": ["error", ">=0.8.19"], "contract-name-camelcase": "off", "const-name-snakecase": "off", "func-name-mixedcase": "off", diff --git a/lib/forge-std b/lib/forge-std index 2b58ecbcf..fc560fa34 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 2b58ecbcf3dfde7a75959dc7b4eb3d0670278de6 +Subproject commit fc560fa34fa12a335a50c35d92e55a6628ca467c diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts index 9eee01c5a..db9ee953a 160000 --- a/lib/openzeppelin-contracts +++ b/lib/openzeppelin-contracts @@ -1 +1 @@ -Subproject commit 9eee01c5a2757fa9bf8421a2810776b885995d2f +Subproject commit db9ee953a17166a51fff42b3c4a29203ef92a492 diff --git a/lib/prb-contracts b/lib/prb-contracts index 5abf1b99e..e34d7acf4 160000 --- a/lib/prb-contracts +++ b/lib/prb-contracts @@ -1 +1 @@ -Subproject commit 5abf1b99e586724f7e79f6468ccc335c286206ce +Subproject commit e34d7acf433d5e7c5f9c45c1aba0799e647744df diff --git a/lib/prb-math b/lib/prb-math index 1edf08dd7..7ce3009bb 160000 --- a/lib/prb-math +++ b/lib/prb-math @@ -1 +1 @@ -Subproject commit 1edf08dd73eb1ace0042459ba719b8ea4a55c0e0 +Subproject commit 7ce3009bbfa0d8e2d430b7a1a9ca46b6e706d90d diff --git a/lib/prb-test b/lib/prb-test index 1d9852eca..cb6a6b168 160000 --- a/lib/prb-test +++ b/lib/prb-test @@ -1 +1 @@ -Subproject commit 1d9852eca009a2a47715e6a28fe53051c0006ff5 +Subproject commit cb6a6b1680f97bedad0c48be452ce31f45a23de1 diff --git a/lib/solarray b/lib/solarray index 10a82b408..84721dbff 160000 --- a/lib/solarray +++ b/lib/solarray @@ -1 +1 @@ -Subproject commit 10a82b4084bcc9fe2ef4a6a0525bc568d40bd797 +Subproject commit 84721dbffa862e6c7529a8c9721acf31d64bf2e4 diff --git a/package.json b/package.json index 331afb11f..82fb60768 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,7 @@ "url": "https://github.com/sablierhq/v2-core/issues" }, "devDependencies": { - "prettier": "^2.8.4", - "rimraf": "^4.4.0", + "prettier": "^2.8.7", "solhint": "^3.4.1" }, "files": [ @@ -24,6 +23,7 @@ "keywords": [ "asset-streaming", "blockchain", + "cryptoasset-streaming", "cryptoassets", "ethereum", "foundry", @@ -46,7 +46,7 @@ "build": "forge build", "build:optimized": "FOUNDRY_PROFILE=optimized forge build", "build:smt": "FOUNDRY_PROFILE=smt forge build", - "clean": "rimraf broadcast cache docs optimized-out out", + "clean": "rm -rf broadcast cache docs optimized-out out", "gas:report": "forge test --gas-report --match-path \"./test/{fuzz,unit}/**/*.sol\" --no-match-test \"test(Fuzz)?_RevertWhen_\\w{1,}?\"", "gas:snapshot": "forge snapshot --match-path \"./test/{fuzz,unit}/**/*.sol\" --no-match-test \"test(Fuzz)?_RevertWhen_\\w{1,}?\"", "gas:snapshot:optimized": "pnpm build:optimized && FOUNDRY_PROFILE=test-optimized forge snapshot --match-path \"./test/{fuzz,unit}/**/*.sol\" --no-match-test \"test(Fork)?(Fuzz)?_RevertWhen_\\w{1,}?\"", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2d41f0e2c..b9415a7b5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,11 +2,8 @@ lockfileVersion: '6.0' devDependencies: prettier: - specifier: ^2.8.4 - version: 2.8.4 - rimraf: - specifier: ^4.4.0 - version: 4.4.0 + specifier: ^2.8.7 + version: 2.8.7 solhint: specifier: ^3.4.1 version: 3.4.1 @@ -209,16 +206,6 @@ packages: once: 1.4.0 dev: true - /glob@9.3.0: - resolution: {integrity: sha512-EAZejC7JvnQINayvB/7BJbpZpNOJ8Lrw2OZNEvQxe0vaLn1SuwMcfV7/MNaX8L/T0wmptBFI4YMtDvSBxYDc7w==} - engines: {node: '>=16 || 14 >=14.17'} - dependencies: - fs.realpath: 1.0.0 - minimatch: 7.4.2 - minipass: 4.2.5 - path-scurry: 1.6.1 - dev: true - /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -296,11 +283,6 @@ packages: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true - /lru-cache@7.18.3: - resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} - engines: {node: '>=12'} - dev: true - /minimatch@5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} engines: {node: '>=10'} @@ -308,18 +290,6 @@ packages: brace-expansion: 2.0.1 dev: true - /minimatch@7.4.2: - resolution: {integrity: sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==} - engines: {node: '>=10'} - dependencies: - brace-expansion: 2.0.1 - dev: true - - /minipass@4.2.5: - resolution: {integrity: sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q==} - engines: {node: '>=8'} - dev: true - /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: @@ -343,14 +313,6 @@ packages: lines-and-columns: 1.2.4 dev: true - /path-scurry@1.6.1: - resolution: {integrity: sha512-OW+5s+7cw6253Q4E+8qQ/u1fVvcJQCJo/VFD8pje+dbJCF1n5ZRMV2AEHbGp+5Q7jxQIYJxkHopnj6nzdGeZLA==} - engines: {node: '>=14'} - dependencies: - lru-cache: 7.18.3 - minipass: 4.2.5 - dev: true - /path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} @@ -361,9 +323,10 @@ packages: engines: {node: '>=4'} dev: true - /prettier@2.8.4: - resolution: {integrity: sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==} + /prettier@2.8.7: + resolution: {integrity: sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==} engines: {node: '>=10.13.0'} + hasBin: true dev: true /punycode@2.3.0: @@ -381,13 +344,6 @@ packages: engines: {node: '>=4'} dev: true - /rimraf@4.4.0: - resolution: {integrity: sha512-X36S+qpCUR0HjXlkDe4NAOhS//aHH0Z+h8Ckf2auGJk3PTnx5rLmrHkwNdbVQuCSUhOyFrlRvFEllZOYE+yZGQ==} - engines: {node: '>=14'} - dependencies: - glob: 9.3.0 - dev: true - /semver@6.3.0: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} dev: true @@ -422,7 +378,7 @@ packages: table: 6.8.1 text-table: 0.2.0 optionalDependencies: - prettier: 2.8.4 + prettier: 2.8.7 dev: true /string-width@4.2.3: diff --git a/remappings.txt b/remappings.txt index 8d59882c9..a5562498a 100644 --- a/remappings.txt +++ b/remappings.txt @@ -6,4 +6,3 @@ erc3156/=lib/ERC3156/contracts/ forge-std/=lib/forge-std/src/ solarray/=lib/solarray/src/ solidity-generators/=lib/solidity-generators/src/ -src/=src/ diff --git a/script/bootstrap/BootstrapProtocol.s.sol b/script/bootstrap/BootstrapProtocol.s.sol index 5cda231b4..9d677451b 100644 --- a/script/bootstrap/BootstrapProtocol.s.sol +++ b/script/bootstrap/BootstrapProtocol.s.sol @@ -8,10 +8,10 @@ import { UD60x18, ud } from "@prb/math/UD60x18.sol"; import { Script } from "forge-std/Script.sol"; import { Solarray } from "solarray/Solarray.sol"; -import { ISablierV2Comptroller } from "src/interfaces/ISablierV2Comptroller.sol"; -import { ISablierV2LockupDynamic } from "src/interfaces/ISablierV2LockupDynamic.sol"; -import { ISablierV2LockupLinear } from "src/interfaces/ISablierV2LockupLinear.sol"; -import { Broker, LockupLinear, LockupDynamic } from "src/types/DataTypes.sol"; +import { ISablierV2Comptroller } from "../../src/interfaces/ISablierV2Comptroller.sol"; +import { ISablierV2LockupDynamic } from "../../src/interfaces/ISablierV2LockupDynamic.sol"; +import { ISablierV2LockupLinear } from "../../src/interfaces/ISablierV2LockupLinear.sol"; +import { Broker, LockupLinear, LockupDynamic } from "../../src/types/DataTypes.sol"; import { BaseScript } from "../shared/Base.s.sol"; diff --git a/src/SablierV2Comptroller.sol b/src/SablierV2Comptroller.sol index 580dfe9cb..64a1f5e35 100644 --- a/src/SablierV2Comptroller.sol +++ b/src/SablierV2Comptroller.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.8.18; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; import { UD60x18 } from "@prb/math/UD60x18.sol"; diff --git a/src/SablierV2LockupDynamic.sol b/src/SablierV2LockupDynamic.sol index a364d3dd1..053bf6897 100644 --- a/src/SablierV2LockupDynamic.sol +++ b/src/SablierV2LockupDynamic.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.8.18; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/token/ERC20/utils/SafeERC20.sol"; diff --git a/src/SablierV2LockupLinear.sol b/src/SablierV2LockupLinear.sol index 0ef09afda..5570b29f8 100644 --- a/src/SablierV2LockupLinear.sol +++ b/src/SablierV2LockupLinear.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.8.18; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/token/ERC20/utils/SafeERC20.sol"; diff --git a/src/SablierV2NFTDescriptor.sol b/src/SablierV2NFTDescriptor.sol index 11d106401..5f0bc0e5f 100644 --- a/src/SablierV2NFTDescriptor.sol +++ b/src/SablierV2NFTDescriptor.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.18; +pragma solidity >=0.8.19; import { IERC721Metadata } from "@openzeppelin/token/ERC721/extensions/IERC721Metadata.sol"; import { ISablierV2NFTDescriptor } from "./interfaces/ISablierV2NFTDescriptor.sol"; diff --git a/src/abstracts/Adminable.sol b/src/abstracts/Adminable.sol index 017478d0a..6cbd952c0 100644 --- a/src/abstracts/Adminable.sol +++ b/src/abstracts/Adminable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; import { IAdminable } from "../interfaces/IAdminable.sol"; import { Errors } from "../libraries/Errors.sol"; diff --git a/src/abstracts/NoDelegateCall.sol b/src/abstracts/NoDelegateCall.sol index cbe1a9349..d6021ac56 100644 --- a/src/abstracts/NoDelegateCall.sol +++ b/src/abstracts/NoDelegateCall.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; import { Errors } from "../libraries/Errors.sol"; diff --git a/src/abstracts/SablierV2Base.sol b/src/abstracts/SablierV2Base.sol index cd2b97278..a75b834c7 100644 --- a/src/abstracts/SablierV2Base.sol +++ b/src/abstracts/SablierV2Base.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.8.18; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/token/ERC20/utils/SafeERC20.sol"; diff --git a/src/abstracts/SablierV2FlashLoan.sol b/src/abstracts/SablierV2FlashLoan.sol index 4cead04ea..6269eccc4 100644 --- a/src/abstracts/SablierV2FlashLoan.sol +++ b/src/abstracts/SablierV2FlashLoan.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.8.18; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/token/ERC20/utils/SafeERC20.sol"; diff --git a/src/abstracts/SablierV2Lockup.sol b/src/abstracts/SablierV2Lockup.sol index 3c92a1216..368139ee4 100644 --- a/src/abstracts/SablierV2Lockup.sol +++ b/src/abstracts/SablierV2Lockup.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.8.18; +pragma solidity >=0.8.19; import { ERC721 } from "@openzeppelin/token/ERC721/ERC721.sol"; import { IERC721Metadata } from "@openzeppelin/token/ERC721/extensions/IERC721Metadata.sol"; diff --git a/src/interfaces/IAdminable.sol b/src/interfaces/IAdminable.sol index 9934a8091..e5ee09561 100644 --- a/src/interfaces/IAdminable.sol +++ b/src/interfaces/IAdminable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; /// @title IAdminable /// @notice Contract module that provides a basic access control mechanism, with an admin that can be diff --git a/src/interfaces/ISablierV2Base.sol b/src/interfaces/ISablierV2Base.sol index 7b775677b..b3bc87401 100644 --- a/src/interfaces/ISablierV2Base.sol +++ b/src/interfaces/ISablierV2Base.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; import { UD60x18 } from "@prb/math/UD60x18.sol"; diff --git a/src/interfaces/ISablierV2Comptroller.sol b/src/interfaces/ISablierV2Comptroller.sol index 718bf6f58..3c4e94c6d 100644 --- a/src/interfaces/ISablierV2Comptroller.sol +++ b/src/interfaces/ISablierV2Comptroller.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; import { UD60x18 } from "@prb/math/UD60x18.sol"; diff --git a/src/interfaces/ISablierV2Lockup.sol b/src/interfaces/ISablierV2Lockup.sol index 15ad1a036..57c2aaa3a 100644 --- a/src/interfaces/ISablierV2Lockup.sol +++ b/src/interfaces/ISablierV2Lockup.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; import { IERC721Metadata } from "@openzeppelin/token/ERC721/extensions/IERC721Metadata.sol"; diff --git a/src/interfaces/ISablierV2LockupDynamic.sol b/src/interfaces/ISablierV2LockupDynamic.sol index b96429b64..26a0c6819 100644 --- a/src/interfaces/ISablierV2LockupDynamic.sol +++ b/src/interfaces/ISablierV2LockupDynamic.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; diff --git a/src/interfaces/ISablierV2LockupLinear.sol b/src/interfaces/ISablierV2LockupLinear.sol index f8325c7a6..a191728a6 100644 --- a/src/interfaces/ISablierV2LockupLinear.sol +++ b/src/interfaces/ISablierV2LockupLinear.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; diff --git a/src/interfaces/ISablierV2NFTDescriptor.sol b/src/interfaces/ISablierV2NFTDescriptor.sol index bb89b3837..80efae4c8 100644 --- a/src/interfaces/ISablierV2NFTDescriptor.sol +++ b/src/interfaces/ISablierV2NFTDescriptor.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; import { IERC721Metadata } from "@openzeppelin/token/ERC721/extensions/IERC721Metadata.sol"; diff --git a/src/interfaces/hooks/ISablierV2LockupRecipient.sol b/src/interfaces/hooks/ISablierV2LockupRecipient.sol index 2c23cd569..0a7f21553 100644 --- a/src/interfaces/hooks/ISablierV2LockupRecipient.sol +++ b/src/interfaces/hooks/ISablierV2LockupRecipient.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; /// @title ISablierV2LockupRecipient /// @notice Interface for recipient contracts capable of reacting to cancellations, renouncements, and withdrawals. diff --git a/src/interfaces/hooks/ISablierV2LockupSender.sol b/src/interfaces/hooks/ISablierV2LockupSender.sol index 84e6f8c18..c3ba379a8 100644 --- a/src/interfaces/hooks/ISablierV2LockupSender.sol +++ b/src/interfaces/hooks/ISablierV2LockupSender.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; /// @title ISablierV2LockupSender /// @notice Interface for sender contracts capable of reacting to cancellations. diff --git a/src/libraries/Errors.sol b/src/libraries/Errors.sol index e8fa290bc..ad2b75bf1 100644 --- a/src/libraries/Errors.sol +++ b/src/libraries/Errors.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; import { UD60x18 } from "@prb/math/UD60x18.sol"; diff --git a/src/libraries/Helpers.sol b/src/libraries/Helpers.sol index 3f10847fc..5e987a91f 100644 --- a/src/libraries/Helpers.sol +++ b/src/libraries/Helpers.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; import { UD60x18, ud } from "@prb/math/UD60x18.sol"; diff --git a/src/types/DataTypes.sol b/src/types/DataTypes.sol index 0398026dd..cf963c35e 100644 --- a/src/types/DataTypes.sol +++ b/src/types/DataTypes.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; import { UD2x18 } from "@prb/math/UD2x18.sol"; diff --git a/src/types/Math.sol b/src/types/Math.sol index 50fffb6ff..7aa3e862c 100644 --- a/src/types/Math.sol +++ b/src/types/Math.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; // This file simply re-exports all PRBMath types needed in v2-core. It is provided for convenience so // that users don't have to install PRBMath separately. diff --git a/src/types/Tokens.sol b/src/types/Tokens.sol index 6d9000b43..658eee2b1 100644 --- a/src/types/Tokens.sol +++ b/src/types/Tokens.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.13; +pragma solidity >=0.8.19; // This file simply re-exports all token interfaces needed in v2-core. It is provided for convenience so // that users don't have to install OpenZeppelin's contracts library separately. diff --git a/test/fork/lockup/dynamic/Dynamic.t.sol b/test/fork/lockup/dynamic/Dynamic.t.sol index 604d32c07..349eb621c 100644 --- a/test/fork/lockup/dynamic/Dynamic.t.sol +++ b/test/fork/lockup/dynamic/Dynamic.t.sol @@ -98,7 +98,7 @@ abstract contract Dynamic_Fork_Test is Fork_Test { /// - It may cancel the stream /// - It may emit a {CancelLockupStream} event /// - /// The fuzzing ensures that all of the following scenarios are tested: + /// Given enough test runs, all of the following scenarios will be fuzzed: /// /// - Multiple values for the funder, recipient, sender, and broker /// - Multiple values for the total amount @@ -119,7 +119,7 @@ abstract contract Dynamic_Fork_Test is Fork_Test { // Fuzz the segment amounts and calculate the create amounts (total, deposit, protocol fee, and broker fee). Vars memory vars; - (vars.totalAmount, vars.createAmounts) = fuzzSegmentAmountsAndCalculateCreateAmounts({ + (vars.totalAmount, vars.createAmounts) = fuzzDynamicStreamAmounts({ upperBound: uint128(initialHolderBalance), segments: params.segments, protocolFee: params.protocolFee, diff --git a/test/fork/lockup/linear/Linear.t.sol b/test/fork/lockup/linear/Linear.t.sol index 6b2e02869..2a640c9de 100644 --- a/test/fork/lockup/linear/Linear.t.sol +++ b/test/fork/lockup/linear/Linear.t.sol @@ -96,7 +96,7 @@ abstract contract Linear_Fork_Test is Fork_Test { /// - It may cancel the stream /// - It may emit a {CancelLockupStream} event /// - /// The fuzzing ensures that all of the following scenarios are tested: + /// Given enough test runs, all of the following scenarios will be fuzzed: /// /// - Multiple values for the the sender, recipient, and broker /// - Multiple values for the total amount diff --git a/test/fuzz/flash-loan/flash-fee/flashFee.t.sol b/test/fuzz/flash-loan/flash-fee/flashFee.t.sol index 2154ac929..e5aa50a19 100644 --- a/test/fuzz/flash-loan/flash-fee/flashFee.t.sol +++ b/test/fuzz/flash-loan/flash-fee/flashFee.t.sol @@ -6,7 +6,7 @@ import { UD60x18, ud } from "@prb/math/UD60x18.sol"; import { FlashLoan_Fuzz_Test } from "../FlashLoan.t.sol"; contract FlashFee_Fuzz_Test is FlashLoan_Fuzz_Test { - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - Multiple values for the comptroller flash fee, including zero /// - Multiple values for the flash loan amount, including zero diff --git a/test/fuzz/flash-loan/flash-loan/flashLoan.t.sol b/test/fuzz/flash-loan/flash-loan/flashLoan.t.sol index e648916d1..561d2454f 100644 --- a/test/fuzz/flash-loan/flash-loan/flashLoan.t.sol +++ b/test/fuzz/flash-loan/flash-loan/flashLoan.t.sol @@ -65,7 +65,7 @@ contract FlashLoanFunction_Fuzz_Test is FlashLoan_Fuzz_Test { _; } - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - Multiple values for the comptroller flash fee, including zero /// - Multiple values for the flash loan amount, including zero diff --git a/test/fuzz/lockup/dynamic/create-with-deltas/createWithDeltas.t.sol b/test/fuzz/lockup/dynamic/create-with-deltas/createWithDeltas.t.sol index ef47e1bcf..c814ffc80 100644 --- a/test/fuzz/lockup/dynamic/create-with-deltas/createWithDeltas.t.sol +++ b/test/fuzz/lockup/dynamic/create-with-deltas/createWithDeltas.t.sol @@ -62,9 +62,9 @@ contract CreateWithDeltas_Dynamic_Fuzz_Test is Dynamic_Fuzz_Test { fuzzSegmentDeltas(segments); // Fuzz the segment amounts and calculate the create amounts (total, deposit, protocol fee, and broker fee). - (vars.totalAmount, vars.createAmounts) = fuzzSegmentAmountsAndCalculateCreateAmounts(segments); + (vars.totalAmount, vars.createAmounts) = fuzzDynamicStreamAmounts(segments); - // Make the sender the stream's funder. + // Make the sender the stream's funder (recall that the sender is the default caller). vars.funder = users.sender; // Load the initial protocol revenues. diff --git a/test/fuzz/lockup/dynamic/create-with-milestones/createWithMilestones.t.sol b/test/fuzz/lockup/dynamic/create-with-milestones/createWithMilestones.t.sol index d86fb7cac..3c2aa64c8 100644 --- a/test/fuzz/lockup/dynamic/create-with-milestones/createWithMilestones.t.sol +++ b/test/fuzz/lockup/dynamic/create-with-milestones/createWithMilestones.t.sol @@ -228,7 +228,7 @@ contract CreateWithMilestones_Dynamic_Fuzz_Test is Dynamic_Fuzz_Test { uint128 totalAmount; } - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - All possible permutations for the funder, sender, recipient, and broker /// - Multiple values for the segment amounts, exponents, and milestones @@ -268,7 +268,7 @@ contract CreateWithMilestones_Dynamic_Fuzz_Test is Dynamic_Fuzz_Test { // Fuzz the segment amounts and calculate the create amounts (total, deposit, protocol fee, and broker fee). Vars memory vars; - (vars.totalAmount, vars.createAmounts) = fuzzSegmentAmountsAndCalculateCreateAmounts({ + (vars.totalAmount, vars.createAmounts) = fuzzDynamicStreamAmounts({ upperBound: UINT128_MAX, segments: params.segments, protocolFee: protocolFee, diff --git a/test/fuzz/lockup/dynamic/streamed-amount-of/streamedAmountOf.sol b/test/fuzz/lockup/dynamic/streamed-amount-of/streamedAmountOf.sol deleted file mode 100644 index 1b2dff6e2..000000000 --- a/test/fuzz/lockup/dynamic/streamed-amount-of/streamedAmountOf.sol +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.19 <0.9.0; - -import { LockupDynamic } from "src/types/DataTypes.sol"; - -import { Dynamic_Fuzz_Test } from "../Dynamic.t.sol"; - -contract StreamedAmountOf_Dynamic_Fuzz_Test is Dynamic_Fuzz_Test { - uint256 internal defaultStreamId; - - modifier whenStreamActive() { - // Create the default stream. - defaultStreamId = createDefaultStream(); - _; - } - - modifier whenStartTimeInThePast() { - _; - } - - /// @dev The fuzzing ensures that all of the following scenarios are tested: - /// - /// - End time in the past - /// - End time in the present - /// - End time in the future - function testFuzz_StreamedAmountOf_OneSegment(uint40 timeWarp) external whenStreamActive whenStartTimeInThePast { - timeWarp = boundUint40(timeWarp, DEFAULT_CLIFF_DURATION, DEFAULT_TOTAL_DURATION * 2); - - // Create a single-element segment array. - LockupDynamic.Segment[] memory segments = new LockupDynamic.Segment[](1); - segments[0] = LockupDynamic.Segment({ - amount: DEFAULT_DEPOSIT_AMOUNT, - exponent: DEFAULT_SEGMENTS[1].exponent, - milestone: DEFAULT_END_TIME - }); - - // Create the stream with the one-segment array. - uint256 streamId = createDefaultStreamWithSegments(segments); - - // Warp into the future. - uint40 currentTime = DEFAULT_START_TIME + timeWarp; - vm.warp({ timestamp: currentTime }); - - // Run the test. - uint128 actualStreamedAmount = dynamic.streamedAmountOf(streamId); - uint128 expectedStreamedAmount = - calculateStreamedAmountForOneSegment(currentTime, segments[0].exponent, DEFAULT_DEPOSIT_AMOUNT); - assertEq(actualStreamedAmount, expectedStreamedAmount, "streamedAmount"); - } - - modifier whenMultipleSegments() { - _; - } - - modifier whenCurrentMilestoneNot1st() { - _; - } - - /// @dev The fuzzing ensures that all of the following scenarios are tested: - /// - /// - End time in the past - /// - End time in the present - /// - End time in the future - function testFuzz_StreamedAmountOf_CurrentMilestoneNot1st(uint40 timeWarp) - external - whenStreamActive - whenStartTimeInThePast - whenMultipleSegments - whenCurrentMilestoneNot1st - { - timeWarp = boundUint40(timeWarp, MAX_SEGMENT_DURATION, DEFAULT_TOTAL_DURATION * 2); - - // Create the stream with the multiple-segment array. - uint256 streamId = createDefaultStreamWithSegments(MAX_SEGMENTS); - - // Warp into the future. - uint40 currentTime = DEFAULT_START_TIME + timeWarp; - vm.warp({ timestamp: currentTime }); - - // Run the test. - uint128 actualStreamedAmount = dynamic.streamedAmountOf(streamId); - uint128 expectedStreamedAmount = - calculateStreamedAmountForMultipleSegments(currentTime, MAX_SEGMENTS, DEFAULT_DEPOSIT_AMOUNT); - assertEq(actualStreamedAmount, expectedStreamedAmount, "streamedAmount"); - } -} diff --git a/test/fuzz/lockup/dynamic/streamed-amount-of/streamedAmountOf.t.sol b/test/fuzz/lockup/dynamic/streamed-amount-of/streamedAmountOf.t.sol new file mode 100644 index 000000000..99bf23d11 --- /dev/null +++ b/test/fuzz/lockup/dynamic/streamed-amount-of/streamedAmountOf.t.sol @@ -0,0 +1,184 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity >=0.8.19 <0.9.0; + +import { ZERO } from "@prb/math/UD60x18.sol"; +import { Broker, LockupDynamic } from "src/types/DataTypes.sol"; + +import { Dynamic_Fuzz_Test } from "../Dynamic.t.sol"; + +contract StreamedAmountOf_Dynamic_Fuzz_Test is Dynamic_Fuzz_Test { + function setUp() public virtual override { + Dynamic_Fuzz_Test.setUp(); + + // Disable the protocol fee so that it doesn't interfere with the calculations. + changePrank({ msgSender: users.admin }); + comptroller.setProtocolFee({ asset: DEFAULT_ASSET, newProtocolFee: ZERO }); + changePrank({ msgSender: users.sender }); + } + + modifier whenStreamActive() { + _; + } + + modifier whenStartTimeInThePast() { + _; + } + + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: + /// + /// - End time in the past + /// - End time in the present + /// - End time in the future + function testFuzz_StreamedAmountOf_OneSegment( + LockupDynamic.Segment memory segment, + uint40 timeWarp + ) + external + whenStreamActive + whenStartTimeInThePast + { + vm.assume(segment.amount != 0); + segment.milestone = boundUint40(segment.milestone, DEFAULT_CLIFF_TIME, DEFAULT_END_TIME); + timeWarp = boundUint40(timeWarp, DEFAULT_CLIFF_DURATION, DEFAULT_TOTAL_DURATION * 2); + + // Create the single-segment array. + LockupDynamic.Segment[] memory segments = new LockupDynamic.Segment[](1); + segments[0] = segment; + + // Mint enough assets to the sender. + deal({ token: address(DEFAULT_ASSET), to: users.sender, give: segment.amount }); + + // Create the stream with the fuzzed segment. + LockupDynamic.CreateWithMilestones memory params = defaultParams.createWithMilestones; + params.totalAmount = segment.amount; + params.segments = segments; + params.broker = Broker({ account: address(0), fee: ZERO }); + uint256 streamId = dynamic.createWithMilestones(params); + + // Warp into the future. + uint40 currentTime = DEFAULT_START_TIME + timeWarp; + vm.warp({ timestamp: currentTime }); + + // Run the test. + uint128 actualStreamedAmount = dynamic.streamedAmountOf(streamId); + uint128 expectedStreamedAmount = calculateStreamedAmountForOneSegment(currentTime, segment); + assertEq(actualStreamedAmount, expectedStreamedAmount, "streamedAmount"); + } + + modifier whenMultipleSegments() { + _; + } + + modifier whenCurrentMilestoneNot1st() { + _; + } + + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: + /// + /// - End time in the past + /// - End time in the present + /// - End time in the future + /// - Multiple deposit amounts + function testFuzz_StreamedAmountOf_Calculation( + LockupDynamic.Segment[] memory segments, + uint40 timeWarp + ) + external + whenStreamActive + whenStartTimeInThePast + whenMultipleSegments + whenCurrentMilestoneNot1st + { + vm.assume(segments.length > 1); + + // Fuzz the segment milestones. + fuzzSegmentMilestones(segments, DEFAULT_START_TIME); + + // Fuzz the segment amounts. + (uint128 totalAmount,) = fuzzDynamicStreamAmounts({ + upperBound: UINT128_MAX, + segments: segments, + protocolFee: ZERO, + brokerFee: ZERO + }); + + // Bound the time warp. + uint40 firstSegmentDuration = segments[1].milestone - segments[0].milestone; + uint40 totalDuration = segments[segments.length - 1].milestone - DEFAULT_START_TIME; + timeWarp = boundUint40(timeWarp, firstSegmentDuration, totalDuration); + + // Mint enough assets to the sender. + deal({ token: address(DEFAULT_ASSET), to: users.sender, give: totalAmount }); + + // Create the stream with the fuzzed segments. + LockupDynamic.CreateWithMilestones memory params = defaultParams.createWithMilestones; + params.totalAmount = totalAmount; + params.segments = segments; + params.broker = Broker({ account: address(0), fee: ZERO }); + uint256 streamId = dynamic.createWithMilestones(params); + + // Warp into the future. + uint40 currentTime = DEFAULT_START_TIME + timeWarp; + vm.warp({ timestamp: currentTime }); + + // Run the test. + uint128 actualStreamedAmount = dynamic.streamedAmountOf(streamId); + uint128 expectedStreamedAmount = calculateStreamedAmountForMultipleSegments(currentTime, segments, totalAmount); + assertEq(actualStreamedAmount, expectedStreamedAmount, "streamedAmount"); + } + + /// @dev The streamed amount must never go down over time. + function testFuzz_StreamedAmountOf_Monotonicity( + LockupDynamic.Segment[] memory segments, + uint40 timeWarp0, + uint40 timeWarp1 + ) + external + whenStreamActive + whenStartTimeInThePast + whenMultipleSegments + whenCurrentMilestoneNot1st + { + vm.assume(segments.length > 1); + + // Fuzz the segment milestones. + fuzzSegmentMilestones(segments, DEFAULT_START_TIME); + + // Fuzz the segment amounts. + (uint128 totalAmount,) = fuzzDynamicStreamAmounts({ + upperBound: UINT128_MAX, + segments: segments, + protocolFee: ZERO, + brokerFee: ZERO + }); + + // Bound the time warps. + uint40 firstSegmentDuration = segments[1].milestone - segments[0].milestone; + uint40 totalDuration = segments[segments.length - 1].milestone - DEFAULT_START_TIME; + timeWarp0 = boundUint40(timeWarp0, firstSegmentDuration, totalDuration - 1); + timeWarp1 = boundUint40(timeWarp1, timeWarp0, totalDuration); + + // Mint enough assets to the sender. + deal({ token: address(DEFAULT_ASSET), to: users.sender, give: totalAmount }); + + // Create the stream with the fuzzed segments. + LockupDynamic.CreateWithMilestones memory params = defaultParams.createWithMilestones; + params.totalAmount = totalAmount; + params.segments = segments; + params.broker = Broker({ account: address(0), fee: ZERO }); + uint256 streamId = dynamic.createWithMilestones(params); + + // Warp into the future for the first time. + vm.warp({ timestamp: DEFAULT_START_TIME + timeWarp0 }); + + // Calculate the streamed amount at this midpoint in time. + uint128 streamedAmount0 = dynamic.streamedAmountOf(streamId); + + // Warp into the future for the second time. + vm.warp({ timestamp: DEFAULT_START_TIME + timeWarp1 }); + + // Assert that this streamed amount is greater than or equal to the previous streamed amount. + uint128 streamedAmount1 = dynamic.streamedAmountOf(streamId); + assertGte(streamedAmount1, streamedAmount0, "streamedAmount"); + } +} diff --git a/test/fuzz/lockup/dynamic/withdraw/withdraw.t.sol b/test/fuzz/lockup/dynamic/withdraw/withdraw.t.sol index c0c8dee75..e8957f655 100644 --- a/test/fuzz/lockup/dynamic/withdraw/withdraw.t.sol +++ b/test/fuzz/lockup/dynamic/withdraw/withdraw.t.sol @@ -15,7 +15,6 @@ contract Withdraw_Dynamic_Fuzz_Test is Dynamic_Fuzz_Test, Withdraw_Fuzz_Test { } struct Params { - uint128 deposit; LockupDynamic.Segment[] segments; uint256 timeWarp; address to; @@ -24,7 +23,6 @@ contract Withdraw_Dynamic_Fuzz_Test is Dynamic_Fuzz_Test, Withdraw_Fuzz_Test { struct Vars { Lockup.Status actualStatus; uint256 actualWithdrawnAmount; - Lockup.CreateAmounts createAmounts; Lockup.Status expectedStatus; uint256 expectedWithdrawnAmount; address funder; @@ -46,39 +44,31 @@ contract Withdraw_Dynamic_Fuzz_Test is Dynamic_Fuzz_Test, Withdraw_Fuzz_Test { vm.assume(params.segments.length != 0); vm.assume(params.to != address(0)); - // Make the sender the stream's funder. + // Make the sender the stream's funder (recall that the sender is the default caller). Vars memory vars; vars.funder = users.sender; // Fuzz the segment milestones. fuzzSegmentMilestones(params.segments, DEFAULT_START_TIME); - // Fuzz the segment amounts and calculate the create amounts (total, deposit, protocol fee, and broker fee). - (vars.totalAmount, vars.createAmounts) = fuzzSegmentAmountsAndCalculateCreateAmounts(params.segments); + // Fuzz the segment amounts. + (vars.totalAmount,) = fuzzDynamicStreamAmounts(params.segments); // Bound the time warp. vars.totalDuration = params.segments[params.segments.length - 1].milestone - DEFAULT_START_TIME; params.timeWarp = bound(params.timeWarp, 1, vars.totalDuration); - // Mint enough assets to the sender. + // Mint enough assets to the funder. deal({ token: address(DEFAULT_ASSET), to: vars.funder, give: vars.totalAmount }); // Make the sender the caller. changePrank({ msgSender: users.sender }); // Create the stream with the fuzzed segments. - vars.streamId = dynamic.createWithMilestones( - LockupDynamic.CreateWithMilestones({ - sender: users.sender, - recipient: users.recipient, - totalAmount: vars.totalAmount, - asset: DEFAULT_ASSET, - cancelable: true, - segments: params.segments, - startTime: DEFAULT_START_TIME, - broker: Broker({ account: users.broker, fee: DEFAULT_BROKER_FEE }) - }) - ); + LockupDynamic.CreateWithMilestones memory createParams = defaultParams.createWithMilestones; + createParams.totalAmount = vars.totalAmount; + createParams.segments = params.segments; + vars.streamId = dynamic.createWithMilestones(createParams); // Warp into the future. vm.warp({ timestamp: DEFAULT_START_TIME + params.timeWarp }); diff --git a/test/fuzz/lockup/dynamic/withdrawable-amount-of/withdrawableAmountOf.t.sol b/test/fuzz/lockup/dynamic/withdrawable-amount-of/withdrawableAmountOf.t.sol index cd506d653..b28511c90 100644 --- a/test/fuzz/lockup/dynamic/withdrawable-amount-of/withdrawableAmountOf.t.sol +++ b/test/fuzz/lockup/dynamic/withdrawable-amount-of/withdrawableAmountOf.t.sol @@ -25,7 +25,7 @@ contract WithdrawableAmountOf_Dynamic_Fuzz_Test is Dynamic_Fuzz_Test { _; } - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - End time in the past /// - End time in the present @@ -59,7 +59,7 @@ contract WithdrawableAmountOf_Dynamic_Fuzz_Test is Dynamic_Fuzz_Test { _; } - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - End time in the past /// - End time in the present diff --git a/test/fuzz/lockup/linear/create-with-durations/createWithDurations.t.sol b/test/fuzz/lockup/linear/create-with-durations/createWithDurations.t.sol index 4cf08b951..85a5ebfd0 100644 --- a/test/fuzz/lockup/linear/create-with-durations/createWithDurations.t.sol +++ b/test/fuzz/lockup/linear/create-with-durations/createWithDurations.t.sol @@ -89,7 +89,7 @@ contract CreateWithDurations_Linear_Fuzz_Test is Linear_Fuzz_Test { durations.total = boundUint40(durations.total, 0, MAX_UNIX_TIMESTAMP); vm.assume(durations.cliff < durations.total); - // Make the sender the stream's funder. + // Make the sender the stream's funder (recall that the sender is the default caller). address funder = users.sender; // Load the initial protocol revenues. diff --git a/test/fuzz/lockup/linear/create-with-range/createWithRange.t.sol b/test/fuzz/lockup/linear/create-with-range/createWithRange.t.sol index 95627130d..165f96e79 100644 --- a/test/fuzz/lockup/linear/create-with-range/createWithRange.t.sol +++ b/test/fuzz/lockup/linear/create-with-range/createWithRange.t.sol @@ -137,7 +137,7 @@ contract CreateWithRange_Linear_Fuzz_Test is Linear_Fuzz_Test { uint128 initialProtocolRevenues; } - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - All possible permutations for the funder, sender, recipient, and broker /// - Multiple values for the total amount diff --git a/test/fuzz/lockup/linear/streamed-amount-of/streamedAmountOf.sol b/test/fuzz/lockup/linear/streamed-amount-of/streamedAmountOf.t.sol similarity index 57% rename from test/fuzz/lockup/linear/streamed-amount-of/streamedAmountOf.sol rename to test/fuzz/lockup/linear/streamed-amount-of/streamedAmountOf.t.sol index 99a0c3144..828a89e33 100644 --- a/test/fuzz/lockup/linear/streamed-amount-of/streamedAmountOf.sol +++ b/test/fuzz/lockup/linear/streamed-amount-of/streamedAmountOf.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity >=0.8.19 <0.9.0; -import { UD60x18, ZERO } from "@prb/math/UD60x18.sol"; +import { ZERO } from "@prb/math/UD60x18.sol"; import { Broker, LockupLinear } from "src/types/DataTypes.sol"; @@ -10,9 +10,19 @@ import { Linear_Fuzz_Test } from "../Linear.t.sol"; contract StreamedAmountOf_Linear_Fuzz_Test is Linear_Fuzz_Test { uint256 internal defaultStreamId; - modifier whenStreamActive() { + function setUp() public virtual override { + Linear_Fuzz_Test.setUp(); + // Create the default stream. defaultStreamId = createDefaultStream(); + + // Disable the protocol fee so that it doesn't interfere with the calculations. + changePrank({ msgSender: users.admin }); + comptroller.setProtocolFee({ asset: DEFAULT_ASSET, newProtocolFee: ZERO }); + changePrank({ msgSender: users.sender }); + } + + modifier whenStreamActive() { _; } @@ -25,20 +35,16 @@ contract StreamedAmountOf_Linear_Fuzz_Test is Linear_Fuzz_Test { } modifier whenCliffTimeInThePast() { - // Disable the protocol fee so that it doesn't interfere with the calculations. - changePrank({ msgSender: users.admin }); - comptroller.setProtocolFee({ asset: DEFAULT_ASSET, newProtocolFee: ZERO }); - changePrank({ msgSender: users.sender }); _; } - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - End time in the past /// - End time in the present /// - End time in the future /// - Multiple deposit amounts - function testFuzz_StreamedAmountOf( + function testFuzz_StreamedAmountOf_Calculation( uint40 timeWarp, uint128 depositAmount ) @@ -52,7 +58,7 @@ contract StreamedAmountOf_Linear_Fuzz_Test is Linear_Fuzz_Test { // Mint enough assets to the sender. deal({ token: address(DEFAULT_ASSET), to: users.sender, give: depositAmount }); - // Create the stream. + // Create the stream with the fuzzed deposit amount. LockupLinear.CreateWithRange memory params = defaultParams.createWithRange; params.totalAmount = depositAmount; params.broker = Broker({ account: address(0), fee: ZERO }); @@ -67,4 +73,40 @@ contract StreamedAmountOf_Linear_Fuzz_Test is Linear_Fuzz_Test { uint128 expectedStreamedAmount = calculateStreamedAmount(currentTime, depositAmount); assertEq(actualStreamedAmount, expectedStreamedAmount, "streamedAmount"); } + + /// @dev The streamed amount must never go down over time. + function testFuzz_StreamedAmountOf_Monotonicity( + uint40 timeWarp0, + uint40 timeWarp1, + uint128 depositAmount + ) + external + whenStreamActive + whenCliffTimeInThePast + { + vm.assume(depositAmount != 0); + timeWarp0 = boundUint40(timeWarp0, DEFAULT_CLIFF_DURATION, DEFAULT_TOTAL_DURATION - 1); + timeWarp1 = boundUint40(timeWarp1, timeWarp0, DEFAULT_TOTAL_DURATION); + + // Mint enough assets to the sender. + deal({ token: address(DEFAULT_ASSET), to: users.sender, give: depositAmount }); + + // Create the stream with the fuzzed deposit amount. + LockupLinear.CreateWithRange memory params = defaultParams.createWithRange; + params.totalAmount = depositAmount; + uint256 streamId = linear.createWithRange(params); + + // Warp into the future for the first time. + vm.warp({ timestamp: DEFAULT_START_TIME + timeWarp0 }); + + // Calculate the streamed amount at this midpoint in time. + uint128 streamedAmount0 = linear.streamedAmountOf(streamId); + + // Warp into the future for the second time. + vm.warp({ timestamp: DEFAULT_START_TIME + timeWarp1 }); + + // Assert that this streamed amount is greater than or equal to the previous streamed amount. + uint128 streamedAmount1 = linear.streamedAmountOf(streamId); + assertGte(streamedAmount1, streamedAmount0, "streamedAmount"); + } } diff --git a/test/fuzz/lockup/linear/withdrawable-amount-of/withdrawableAmountOf.t.sol b/test/fuzz/lockup/linear/withdrawable-amount-of/withdrawableAmountOf.t.sol index d93a2e417..0013456eb 100644 --- a/test/fuzz/lockup/linear/withdrawable-amount-of/withdrawableAmountOf.t.sol +++ b/test/fuzz/lockup/linear/withdrawable-amount-of/withdrawableAmountOf.t.sol @@ -32,7 +32,7 @@ contract WithdrawableAmountOf_Linear_Fuzz_Test is Linear_Fuzz_Test { _; } - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - End time in the past /// - End time in the present @@ -67,7 +67,7 @@ contract WithdrawableAmountOf_Linear_Fuzz_Test is Linear_Fuzz_Test { assertEq(actualWithdrawableAmount, expectedWithdrawableAmount, "withdrawableAmount"); } - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - End time in the past /// - End time in the present diff --git a/test/fuzz/lockup/shared/cancel/cancel.t.sol b/test/fuzz/lockup/shared/cancel/cancel.t.sol index 9bce92f5e..367873f74 100644 --- a/test/fuzz/lockup/shared/cancel/cancel.t.sol +++ b/test/fuzz/lockup/shared/cancel/cancel.t.sol @@ -63,7 +63,7 @@ abstract contract Cancel_Fuzz_Test is Fuzz_Test, Lockup_Shared_Test { _; } - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - Multiple values for the current time /// - With and without withdrawals diff --git a/test/fuzz/lockup/shared/withdraw/withdraw.t.sol b/test/fuzz/lockup/shared/withdraw/withdraw.t.sol index 27576a87d..782d501b8 100644 --- a/test/fuzz/lockup/shared/withdraw/withdraw.t.sol +++ b/test/fuzz/lockup/shared/withdraw/withdraw.t.sol @@ -22,7 +22,7 @@ abstract contract Withdraw_Fuzz_Test is Fuzz_Test, Lockup_Shared_Test { _; } - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - Multiple values for the current time. /// - Multiple values for the withdrawal address. @@ -98,7 +98,7 @@ abstract contract Withdraw_Fuzz_Test is Fuzz_Test, Lockup_Shared_Test { _; } - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - Multiple values for the withdrawal address. function testFuzz_Withdraw_CallerRecipient(address to) @@ -163,7 +163,7 @@ abstract contract Withdraw_Fuzz_Test is Fuzz_Test, Lockup_Shared_Test { assertEq(actualWithdrawnAmount, expectedWithdrawnAmount, "withdrawnAmount"); } - /// @dev The fuzzing ensures that all of the following scenarios are tested: + /// @dev Given enough test runs, all of the following scenarios will be fuzzed: /// /// - End time in the past /// - End time in the present diff --git a/test/invariant/handlers/LockupDynamicCreateHandler.t.sol b/test/invariant/handlers/LockupDynamicCreateHandler.t.sol index fae6938f6..d5cdd144d 100644 --- a/test/invariant/handlers/LockupDynamicCreateHandler.t.sol +++ b/test/invariant/handlers/LockupDynamicCreateHandler.t.sol @@ -75,7 +75,7 @@ contract LockupDynamicCreateHandler is BaseHandler { fuzzSegmentDeltas(params.segments); // Fuzz the segment amounts and calculate the create amounts (total, deposit, protocol fee, and broker fee). - (params.totalAmount,) = fuzzSegmentAmountsAndCalculateCreateAmounts({ + (params.totalAmount,) = fuzzDynamicStreamAmounts({ upperBound: 1_000_000_000e18, segments: params.segments, protocolFee: comptroller.protocolFees(asset), @@ -119,7 +119,7 @@ contract LockupDynamicCreateHandler is BaseHandler { fuzzSegmentMilestones(params.segments, params.startTime); // Fuzz the segment amounts and calculate the create amounts (total, deposit, protocol fee, and broker fee). - (params.totalAmount,) = fuzzSegmentAmountsAndCalculateCreateAmounts({ + (params.totalAmount,) = fuzzDynamicStreamAmounts({ upperBound: 1_000_000_000e18, segments: params.segments, protocolFee: comptroller.protocolFees(asset), diff --git a/test/invariant/lockup/Lockup.t.sol b/test/invariant/lockup/Lockup.t.sol index ad738cd80..5741a7b95 100644 --- a/test/invariant/lockup/Lockup.t.sol +++ b/test/invariant/lockup/Lockup.t.sol @@ -114,6 +114,7 @@ abstract contract Lockup_Invariant_Test is Invariant_Test { } } + /// @dev A canceled stream must have a non-zero refunded amount. function invariant_StreamCanceledNonZeroRefundedAmount() external { uint256 lastStreamId = lockupHandlerStorage.lastStreamId(); for (uint256 i = 0; i < lastStreamId; ++i) { @@ -128,6 +129,7 @@ abstract contract Lockup_Invariant_Test is Invariant_Test { } } + /// @dev A canceled stream must have a non-zero withdrawable amount. function invariant_StreamCanceledNonZeroWithdrawableAmount() external { uint256 lastStreamId = lockupHandlerStorage.lastStreamId(); for (uint256 i = 0; i < lastStreamId; ++i) { diff --git a/test/invariant/lockup/dynamic/Dynamic.t.sol b/test/invariant/lockup/dynamic/Dynamic.t.sol index 17899496c..afa97616d 100644 --- a/test/invariant/lockup/dynamic/Dynamic.t.sol +++ b/test/invariant/lockup/dynamic/Dynamic.t.sol @@ -59,7 +59,7 @@ contract Dynamic_Invariant_Test is Lockup_Invariant_Test { INVARIANTS //////////////////////////////////////////////////////////////////////////*/ - /// @dev No created stream can have a deposited amount of zero. + /// @dev The deposited amount must not be zero. function invariant_DepositedAmountNotZero() external { uint256 lastStreamId = lockupHandlerStorage.lastStreamId(); for (uint256 i = 0; i < lastStreamId; ++i) { @@ -79,7 +79,7 @@ contract Dynamic_Invariant_Test is Lockup_Invariant_Test { } } - /// @dev The protocol does not allow creating streams with unordered segment milestones. + /// @dev Unordered segment milestones are not allowed. function invariant_SegmentMilestonesOrdered() external { uint256 lastStreamId = lockupHandlerStorage.lastStreamId(); for (uint256 i = 0; i < lastStreamId; ++i) { diff --git a/test/invariant/lockup/linear/Linear.t.sol b/test/invariant/lockup/linear/Linear.t.sol index e2c030276..f6b795bb0 100644 --- a/test/invariant/lockup/linear/Linear.t.sol +++ b/test/invariant/lockup/linear/Linear.t.sol @@ -58,7 +58,7 @@ contract Linear_Invariant_Test is Lockup_Invariant_Test { INVARIANTS //////////////////////////////////////////////////////////////////////////*/ - /// @dev The cliff time cannot be less than the start time. + /// @dev The cliff time must not be less than the start time. function invariant_CliffTimeGteStartTime() external { uint256 lastStreamId = lockupHandlerStorage.lastStreamId(); for (uint256 i = 0; i < lastStreamId; ++i) { @@ -71,7 +71,7 @@ contract Linear_Invariant_Test is Lockup_Invariant_Test { } } - /// @dev No stream can have a deposited amount of zero. + /// @dev The deposited amount must not be zero. function invariant_DepositedAmountNotZero() external { uint256 lastStreamId = lockupHandlerStorage.lastStreamId(); for (uint256 i = 0; i < lastStreamId; ++i) { @@ -81,7 +81,7 @@ contract Linear_Invariant_Test is Lockup_Invariant_Test { } } - /// @dev The end time cannot be less than or equal to the cliff time. + /// @dev The end time must not be less than or equal to the cliff time. function invariant_EndTimeGtCliffTime() external { uint256 lastStreamId = lockupHandlerStorage.lastStreamId(); for (uint256 i = 0; i < lastStreamId; ++i) { @@ -92,7 +92,7 @@ contract Linear_Invariant_Test is Lockup_Invariant_Test { } } - /// @dev The end time cannot be zero because it must be greater than the start time (which can be zero). + /// @dev The end time must not be zero because it must be greater than the start time (which can be zero). function invariant_EndTimeNotZero() external { uint256 lastStreamId = lockupHandlerStorage.lastStreamId(); for (uint256 i = 0; i < lastStreamId; ++i) { diff --git a/test/shared/Calculations.t.sol b/test/shared/Calculations.t.sol index 81549bba9..47e57cf4e 100644 --- a/test/shared/Calculations.t.sol +++ b/test/shared/Calculations.t.sol @@ -101,23 +101,22 @@ abstract contract Calculations is Constants { /// {SablierV2LockupDynamic-_calculateStreamedAmountForOneSegment}. function calculateStreamedAmountForOneSegment( uint40 currentTime, - UD2x18 exponent, - uint128 depositAmount + LockupDynamic.Segment memory segment ) internal view returns (uint128 streamedAmount) { - if (currentTime >= DEFAULT_END_TIME) { - return depositAmount; + if (currentTime >= segment.milestone) { + return segment.amount; } unchecked { SD59x18 elapsedTime = (currentTime - DEFAULT_START_TIME).intoSD59x18(); - SD59x18 totalTime = DEFAULT_TOTAL_DURATION.intoSD59x18(); + SD59x18 totalTime = (segment.milestone - DEFAULT_START_TIME).intoSD59x18(); SD59x18 elapsedTimePercentage = elapsedTime.div(totalTime); - SD59x18 multiplier = elapsedTimePercentage.pow(exponent.intoSD59x18()); - SD59x18 streamedAmountSd = multiplier.mul(depositAmount.intoSD59x18()); + SD59x18 multiplier = elapsedTimePercentage.pow(segment.exponent.intoSD59x18()); + SD59x18 streamedAmountSd = multiplier.mul(segment.amount.intoSD59x18()); streamedAmount = uint128(streamedAmountSd.intoUint256()); } } diff --git a/test/shared/Events.t.sol b/test/shared/Events.t.sol index 137347989..220b7929b 100644 --- a/test/shared/Events.t.sol +++ b/test/shared/Events.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.18; +pragma solidity >=0.8.19; import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; import { UD60x18 } from "@prb/math/UD60x18.sol"; diff --git a/test/shared/Fuzzers.t.sol b/test/shared/Fuzzers.t.sol index db05c8401..707b03573 100644 --- a/test/shared/Fuzzers.t.sol +++ b/test/shared/Fuzzers.t.sol @@ -13,13 +13,13 @@ import { Utils } from "./Utils.t.sol"; abstract contract Fuzzers is Constants, Utils { using CastingUint128 for uint128; - /// @dev Just like {fuzzSegmentAmountsAndCalculateCreateAmounts} but using some defaults. - function fuzzSegmentAmountsAndCalculateCreateAmounts(LockupDynamic.Segment[] memory segments) + /// @dev Just like {fuzzDynamicStreamAmounts} but with defaults. + function fuzzDynamicStreamAmounts(LockupDynamic.Segment[] memory segments) internal view returns (uint128 totalAmount, Lockup.CreateAmounts memory createAmounts) { - (totalAmount, createAmounts) = fuzzSegmentAmountsAndCalculateCreateAmounts({ + (totalAmount, createAmounts) = fuzzDynamicStreamAmounts({ upperBound: UINT128_MAX, segments: segments, protocolFee: DEFAULT_PROTOCOL_FEE, @@ -27,14 +27,14 @@ abstract contract Fuzzers is Constants, Utils { }); } - /// @dev Just like {fuzzSegmentAmountsAndCalculateCreateAmounts} but using some defaults. - function fuzzSegmentAmountsAndCalculateCreateAmounts(LockupDynamic.SegmentWithDelta[] memory segments) + /// @dev Just like {fuzzDynamicStreamAmounts} but with defaults. + function fuzzDynamicStreamAmounts(LockupDynamic.SegmentWithDelta[] memory segments) internal view returns (uint128 totalAmount, Lockup.CreateAmounts memory createAmounts) { LockupDynamic.Segment[] memory segmentsWithMilestones = getSegmentsWithMilestones(segments); - (totalAmount, createAmounts) = fuzzSegmentAmountsAndCalculateCreateAmounts({ + (totalAmount, createAmounts) = fuzzDynamicStreamAmounts({ upperBound: UINT128_MAX, segments: segmentsWithMilestones, protocolFee: DEFAULT_PROTOCOL_FEE, @@ -47,7 +47,7 @@ abstract contract Fuzzers is Constants, Utils { /// @dev Fuzzes the segment amounts and calculates the create amounts (total, deposit, protocol fee, and broker /// fee). - function fuzzSegmentAmountsAndCalculateCreateAmounts( + function fuzzDynamicStreamAmounts( uint128 upperBound, LockupDynamic.SegmentWithDelta[] memory segments, UD60x18 protocolFee, @@ -59,7 +59,7 @@ abstract contract Fuzzers is Constants, Utils { { LockupDynamic.Segment[] memory segmentsWithMilestones = getSegmentsWithMilestones(segments); (totalAmount, createAmounts) = - fuzzSegmentAmountsAndCalculateCreateAmounts(upperBound, segmentsWithMilestones, protocolFee, brokerFee); + fuzzDynamicStreamAmounts(upperBound, segmentsWithMilestones, protocolFee, brokerFee); for (uint256 i = 0; i < segmentsWithMilestones.length; ++i) { segments[i].amount = segmentsWithMilestones[i].amount; } @@ -67,7 +67,7 @@ abstract contract Fuzzers is Constants, Utils { /// @dev Fuzzes the segment amounts and calculates the create amounts (total, deposit, protocol fee and broker /// fee). - function fuzzSegmentAmountsAndCalculateCreateAmounts( + function fuzzDynamicStreamAmounts( uint128 upperBound, LockupDynamic.Segment[] memory segments, UD60x18 protocolFee,