hats-finance / Tokemak-0x4a2d708ea6b0c04186ecb774cfad1e50fb5efc0b

0 stars 0 forks source link

Loss of precision #14

Open hats-bug-reporter[bot] opened 5 months ago

hats-bug-reporter[bot] commented 5 months ago

Github username: -- Twitter username: -- Submission hash (on-chain): 0xdfcb7680f60a31235951712f2ff8cee290c974857b412632b341454222695d19 Severity: low

Description: Description\ Division by large numbers may result in the result being zero, due to solidity not supporting fractions. Consider requiring a minimum amount for the numerator to ensure that it is always larger than the denominator

Instances (4):

File: LMPStrategy.sol

560:             return destValueAfterRebalance * 1e18 / lmpAssetsAfterRebalance >= trimAmount;

720:             result.baseApr = interimStats.baseApr / reservesTotal;

721:             result.priceReturn = interimStats.priceReturn / convertUintToInt(reservesTotal);

833:             return (totalRewards * 1e18) / totalSupplyInEth;
codenutt commented 5 months ago

Duplicate of https://github.com/hats-finance/Tokemak-0x4a2d708ea6b0c04186ecb774cfad1e50fb5efc0b/issues/13