Skip to main content

Diagrams

Flow Storage Layout

Each Flow contract is a singleton that stores all streams created by that contract's users. The following diagrams provide insight into the storage layout. To see the list of all storage variables, click here.

Function calls

Notes:

  1. The arrows point to the status on which the function can be called.
  2. The "update" comments refer only to the stream internal state.
  3. st is always updated to block.timestamp.
  4. Red lines refers to the function that are doing an ERC-20 transfer

Internal State

The stream struct has more fields than the ones shown here, but these are the most relevant ones.

ERC-20 Transfer Actions

 ~

Amount Calculations

Ongoing Debt

Uncovered Debt

Notes: A non-zero uncovered debt implies:

  1. bal < sd when the status is PAUSED
  2. bal < sd + od when the status is STREAMING

Covered debt

Refundable Amount