Skip to main content

FuroStreamRouter

FuroStreamRouter contract is the contract that is directly used to create and update token streams, complete with full deposit / withdraw functionality - all on BentoBox!

The full contract can be found here.

Functions

setBentoBoxApproval

function setBentoBoxApproval(
address user,
bool approved,
uint8 v,
bytes32 r,
bytes32 s
) external payable

Approves this contract for BentoBox.

Parameters

NameTypeDescription
useraddressuser address to set as owner in BentoBox
approvedboolboolean if approved or not by BentoBox
vuint8recovery byte of the signature
rbytes32half of the ECDSA signature pair
sbytes32half of the ECDSA signature pair

createStream

function createStream(
address recipient,
address token,
uint64 startTime,
uint64 endTime,
uint256 amount, /// @dev in token amount and not in shares
bool fromBentoBox,
uint256 minShare
) external payable returns (uint256 streamId, uint256 depositedShares)

Creates a new token stream.

Parameters

NameTypeDescription
recipientaddressrecipient address
tokenaddressaddress of token to create stream for
startTimeuint64when stream starts
endTimeuint64when stream will end
amountuint256amount of token to stream (in token amount, not shares)
fromBentoBoxboolboolean for if stream is coming from BentoBox or not
minShareuint256minimum amount of shares

Returns

NameTypeDescription
streamIduint256new stream's ID
depositedSharesuint256amount of shares deposited in stream

_depositToken

function _depositToken(
address token,
address from,
address to,
uint256 amount,
bool fromBentoBox
) internal returns (uint256 depositedShares)

Internal function that deposits a token into a stream.

Parameters

NameTypeDescription
tokenaddressaddress of token to deposit
fromaddressaddress of user depositing tokens
toaddressaddress of token recipient
amountuint256amount of tokens to deposit
fromBentoBoxboolboolean of whether update is coming from BentoBox or not

Returns

NameTypeDescription
depositedSharesuint256amount of shares deposited in stream