Skip to main content

Helpers

Git Source

Library with helper functions in SablierFlow contract.

Functions

descaleAmount

Descales the provided amount from 18 decimals fixed-point number to token's decimals number.

If decimals exceeds 18, it will cause an underflow.

function descaleAmount(uint256 amount, uint8 decimals) internal pure returns (uint256);

scaleAmount

Scales the provided amount from token's decimals number to 18 decimals fixed-point number.

If decimals exceeds 18, it will cause an underflow. If amount exceeds max value of uint128, the result may overflow uint256.

function scaleAmount(uint256 amount, uint8 decimals) internal pure returns (uint256);