Skip to main content

Errors

Background

Sablier employs the convenient and gas-efficient custom errors introduced in Solidity v0.8.4.

The error data encoding is identical to the ABI encoding used for function calls, e.g.:

abi.encodeWithSignature("SablierV2Lockup_Unauthorized(address,uint256)", streamId, msg.sender).

Naming Pattern

With the exception of a few generics, all errors in Sablier V2 adhere to the naming pattern SablierV2<ContractName>_<ErrorName>.

Incorporating the contract name as a prefix offers context, making it easier for end users to pinpoint the contract responsible for a reverted transaction. This approach is particularly helpful for complex transactions involving multiple contracts.

Error List

Core

CallerNotAdmin

Thrown when the caller is not the admin.

error CallerNotAdmin(address admin, address caller);

DelegateCall

Thrown when attempting to delegate call to a function that does not allow delegate calls.

error DelegateCall();

SablierV2Base_NoProtocolRevenues

Thrown when attempting to claim protocol revenues for an asset that did not accrue any revenues.

error SablierV2Base_NoProtocolRevenues(IERC20 asset);

SablierV2FlashLoan_AmountTooHigh

Thrown when attempting to flash loan an amount that is greater than or equal to 2^128.

error SablierV2FlashLoan_AmountTooHigh(uint256 amount);

SablierV2FlashLoan_AssetNotFlashLoanable

Thrown when attempting to flash loan an asset that is not supported.

error SablierV2FlashLoan_AssetNotFlashLoanable(IERC20 asset);

SablierV2FlashLoan_CalculatedFeeTooHigh

Thrown when during a flash loan the calculated fee is greater than or equal to 2^128.

error SablierV2FlashLoan_CalculatedFeeTooHigh(uint256 amount);

SablierV2FlashLoan_FlashBorrowFail

Thrown when the callback to the flash borrower failed.

error SablierV2FlashLoan_FlashBorrowFail();

SablierV2FlashLoan_InsufficientAssetLiquidity

Thrown when attempting to flash loan more than is available for lending.

error SablierV2FlashLoan_InsufficientAssetLiquidity(IERC20 asset, uint256 amountAvailable, uint256 amountRequested);

SablierV2Lockup_BrokerFeeTooHigh

Thrown when the broker fee is greater than the maximum fee permitted.

error SablierV2Lockup_BrokerFeeTooHigh(UD60x18 brokerFee, UD60x18 maxFee);

SablierV2Lockup_DepositAmountZero

Thrown when attempting to create a stream with a zero deposit amount.

error SablierV2Lockup_DepositAmountZero();

SablierV2Lockup_ProtocolFeeTooHigh

Thrown when the protocol fee is greater than the maximum fee permitted.

error SablierV2Lockup_ProtocolFeeTooHigh(UD60x18 protocolFee, UD60x18 maxFee);

SablierV2Lockup_RenounceNonCancelableStream

Thrown when attempting to renounce an already non-cancelable stream.

error SablierV2Lockup_RenounceNonCancelableStream(uint256 streamId);

SablierV2Lockup_StreamNonCancelable

Thrown when attempting to cancel a stream that is already non-cancelable.

error SablierV2Lockup_StreamNonCancelable(uint256 streamId);

SablierV2Lockup_StreamNotActive

Thrown when the stream id points to a stream that is not active.

error SablierV2Lockup_StreamNotActive(uint256 streamId);

SablierV2Lockup_StreamNotCanceledOrDepleted

Thrown when the stream id points to a stream that is not canceled or depleted.

error SablierV2Lockup_StreamNotCanceledOrDepleted(uint256 streamId);

SablierV2Lockup_Unauthorized

Thrown when the msg.sender is not authorized to perform some action.

error SablierV2Lockup_Unauthorized(uint256 streamId, address caller);

SablierV2Lockup_WithdrawAmountGreaterThanWithdrawableAmount

Thrown when attempting to withdraw more than can be withdrawn.

error SablierV2Lockup_WithdrawAmountGreaterThanWithdrawableAmount(
uint256 streamId, uint128 amount, uint128 withdrawableAmount
);

SablierV2Lockup_WithdrawAmountZero

Thrown when attempting to withdraw zero assets from a stream.

The id of the stream.

error SablierV2Lockup_WithdrawAmountZero(uint256 streamId);

SablierV2Lockup_WithdrawArrayCountsNotEqual

Thrown when attempting to withdraw from multiple streams and the count of the stream ids does not match the count of the amounts.

error SablierV2Lockup_WithdrawArrayCountsNotEqual(uint256 streamIdsCount, uint256 amountsCount);

SablierV2Lockup_WithdrawSenderUnauthorized

Thrown when the sender of the stream attempts to withdraw to some address other than the recipient.

error SablierV2Lockup_WithdrawSenderUnauthorized(uint256 streamId, address sender, address to);

SablierV2Lockup_WithdrawToZeroAddress

Thrown when attempting to withdraw to a zero address.

error SablierV2Lockup_WithdrawToZeroAddress();

SablierV2LockupLinear_CliffTimeNotLessThanEndTime

Thrown when attempting to create a stream with a cliff time that is not strictly less than the end time.

error SablierV2LockupLinear_CliffTimeNotLessThanEndTime(uint40 cliffTime, uint40 endTime);

SablierV2LockupLinear_StartTimeGreaterThanCliffTime

Thrown when attempting to create a stream with a start time greater than the cliff time.

error SablierV2LockupLinear_StartTimeGreaterThanCliffTime(uint40 startTime, uint40 cliffTime);

SablierV2LockupDynamic_DepositAmountNotEqualToSegmentAmountsSum

Thrown when attempting to create a stream with a deposit amount that does not equal the segment amounts sum.

error SablierV2LockupDynamic_DepositAmountNotEqualToSegmentAmountsSum(uint128 depositAmount, uint128 segmentAmountsSum);

SablierV2LockupDynamic_SegmentCountTooHigh

Thrown when attempting to create a stream with more segments than the maximum permitted.

error SablierV2LockupDynamic_SegmentCountTooHigh(uint256 count);

SablierV2LockupDynamic_SegmentCountZero

Thrown when attempting to create a stream with zero segments.

error SablierV2LockupDynamic_SegmentCountZero();

SablierV2LockupDynamic_SegmentMilestonesNotOrdered

Thrown when attempting to create a stream with segment milestones that are not ordered.

error SablierV2LockupDynamic_SegmentMilestonesNotOrdered(
uint256 index, uint40 previousMilestone, uint40 currentMilestone
);

SablierV2LockupDynamic_StartTimeNotLessThanFirstSegmentMilestone

Thrown when attempting to create a stream with a start time that is not strictly less than the first segment milestone.

error SablierV2LockupDynamic_StartTimeNotLessThanFirstSegmentMilestone(uint40 startTime, uint40 firstSegmentMilestone);

Periphery

note

This section is a stub

Resources