We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_fromUnderlyingAmount
// this should be in SuperToken.sol uint8 private constant _STANDARD_DECIMALS = 18; function _fromUnderlyingAmount(ISuperToken superToken, uint256 amount) private view returns (uint256 superTokenAmount, uint256 adjustedAmount) { uint256 factor; uint8 _underlyingDecimals = superToken.getUnderlyingDecimals(); if (_underlyingDecimals < _STANDARD_DECIMALS) { factor = 10 ** (_STANDARD_DECIMALS - _underlyingDecimals); superTokenAmount = amount * factor; adjustedAmount = amount; } else if (_underlyingDecimals > _STANDARD_DECIMALS) { factor = 10 ** (_underlyingDecimals - _STANDARD_DECIMALS); superTokenAmount = amount / factor; adjustedAmount = superTokenAmount * factor; } else { superTokenAmount = adjustedAmount = amount; } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: