sablier-labs / flow

🍃 Smart contracts of the Sablier Flow protocol.
Other
8 stars 0 forks source link

Change datatypes as per Cantina recommendation #295

Closed smol-ninja closed 5 days ago

smol-ninja commented 1 week ago

Findings

  1. https://cantina.xyz/code/99ae802b-f05c-4e36-a1d1-240d5146649c/findings/1
  2. https://cantina.xyz/code/99ae802b-f05c-4e36-a1d1-240d5146649c/findings/2
  3. https://cantina.xyz/code/99ae802b-f05c-4e36-a1d1-240d5146649c/findings/3
  4. https://cantina.xyz/code/99ae802b-f05c-4e36-a1d1-240d5146649c/findings/4
  5. https://cantina.xyz/code/99ae802b-f05c-4e36-a1d1-240d5146649c/findings/8

Recommandation

  1. Use uint256 for scaledOngoingDebt and for all values until its absolutely necessary to downcast to amounts
  2. Add notNull to isTransferable getter
  3. Use uint256 for solvencyAmount in depletionTimeOf()
  4. Return uint256 in depletionTimeOf()
  5. Calculate depletion time when totalDebt == balance