CollateralUtils

Collaterals decimal precision internal library

CollateralConfig

struct CollateralConfig {
  uint128 precision;
  uint128 precisionDelta;
}

getCollateralConfig

function getCollateralConfig(address _token) internal view returns (struct CollateralUtils.CollateralConfig _meta)

_Calculates precision (10^decimals) and precisionDelta (precision difference between 18 decimals and token decimals) of a given IERC20 token

Notice: not compatible with tokens with more than 18 decimals_

Parameters

Name
Type
Description

_token

address

collateral token address