Skip to main content

ISablierFlowState

Git Source

Contract with state variables (storage and constants) for the SablierFlow contract, their respective getters and helpful modifiers.

Functions

aggregateAmount

Retrieves the aggregate amount across all streams, denoted in units of the token's decimals.

If tokens are directly transferred to the contract without using the stream creation functions, the ERC-20 balance may be greater than the aggregate amount.

function aggregateAmount(IERC20 token) external view returns (uint256);

Parameters

NameTypeDescription
tokenIERC20The ERC-20 token for the query.

getBalance

Retrieves the balance of the stream, i.e. the total deposited amounts subtracted by the total withdrawn amounts, denoted in token's decimals.

Reverts if streamId references a null stream.

function getBalance(uint256 streamId) external view returns (uint128 balance);

Parameters

NameTypeDescription
streamIduint256The stream ID for the query.

getRatePerSecond

Retrieves the rate per second of the stream, denoted as a fixed-point number where 1e18 is 1 token per second.

Reverts if streamId references a null stream.

function getRatePerSecond(uint256 streamId) external view returns (UD21x18 ratePerSecond);

Parameters

NameTypeDescription
streamIduint256The ID of the stream to make the query for.

getSender

Retrieves the stream's sender.

Reverts if streamId references a null stream.

function getSender(uint256 streamId) external view returns (address sender);

Parameters

NameTypeDescription
streamIduint256The stream ID for the query.

getSnapshotDebtScaled

Retrieves the snapshot debt of the stream, denoted as a fixed-point number where 1e18 is 1 token.

Reverts if streamId references a null stream.

function getSnapshotDebtScaled(uint256 streamId) external view returns (uint256 snapshotDebtScaled);

Parameters

NameTypeDescription
streamIduint256The stream ID for the query.

getSnapshotTime

Retrieves the snapshot time of the stream, which is a Unix timestamp.

Reverts if streamId references a null stream.

function getSnapshotTime(uint256 streamId) external view returns (uint40 snapshotTime);

Parameters

NameTypeDescription
streamIduint256The ID of the stream to make the query for.

getStream

Retrieves the stream entity.

Reverts if streamId references a null stream.

function getStream(uint256 streamId) external view returns (Flow.Stream memory stream);

Parameters

NameTypeDescription
streamIduint256The stream ID for the query.

getToken

Retrieves the token of the stream.

Reverts if streamId references a null stream.

function getToken(uint256 streamId) external view returns (IERC20 token);

Parameters

NameTypeDescription
streamIduint256The ID of the stream to make the query for.

getTokenDecimals

Retrieves the token decimals of the stream.

Reverts if streamId references a null stream.

function getTokenDecimals(uint256 streamId) external view returns (uint8 tokenDecimals);

Parameters

NameTypeDescription
streamIduint256The ID of the stream to make the query for.

isStream

Retrieves a flag indicating whether the stream exists.

Does not revert if streamId references a null stream.

function isStream(uint256 streamId) external view returns (bool result);

Parameters

NameTypeDescription
streamIduint256The stream ID for the query.

isTransferable

Retrieves a flag indicating whether the stream NFT is transferable.

Reverts if streamId references a null stream.

function isTransferable(uint256 streamId) external view returns (bool result);

Parameters

NameTypeDescription
streamIduint256The stream ID for the query.

isVoided

Retrieves a flag indicating whether the stream is voided.

Reverts if streamId references a null stream.

function isVoided(uint256 streamId) external view returns (bool result);

Parameters

NameTypeDescription
streamIduint256The stream ID for the query.

nativeToken

Retrieves the address of the ERC-20 interface of the native token, if it exists.

The native tokens on some chains have a dual interface as ERC-20. For example, on Polygon the $POL token is the native token and has an ERC-20 version at 0x0000000000000000000000000000000000001010. This means that address(this).balance returns the same value as balanceOf(address(this)). To avoid any unintended behavior, these tokens cannot be used in Sablier. As an alternative, users can use the Wrapped version of the token, i.e. WMATIC, which is a standard ERC-20 token.

function nativeToken() external view returns (address);

nextStreamId

Counter for stream ids.

function nextStreamId() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The next stream ID.

nftDescriptor

Contract that generates the non-fungible token URI.

function nftDescriptor() external view returns (IFlowNFTDescriptor);