Closed c4-bot-10 closed 9 months ago
0xRobocop marked the issue as duplicate of #757
0xA5DF marked the issue as unsatisfactory: Out of scope
0xA5DF marked the issue as satisfactory
0xA5DF marked the issue as unsatisfactory: Out of scope
0xA5DF marked the issue as unsatisfactory: Out of scope
Lines of code
https://github.com/code-423n4/2024-02-althea-liquid-infrastructure/blob/bd6ee47162368e1999a0a5b8b17b701347cf9a7d/liquid-infrastructure/contracts/LiquidInfrastructureERC20.sol#L275
Vulnerability details
Vulnerability details
Tokens inteded to be used as reward tokens (i.e.
distributableERC20s
), mentioned by the sponsor, such as USDC and USDT have only 6 decimals andLiquidInfrastructureERC20
has 18 decimals. As a result, the calculation forentitlement
in LiquidInfrastructureERC20.sol#L275 will result in 0 due to precision loss and such tokens will never be properly distributed.Imapact
Tokens with less than 18 decimals will never be distributed due to precision loss.
Proof of Concept
The code bellow illustrates how tokens with less than than 18 decimals, such as USDC, will never be distributed due to precision loss:
Tools Used
Foundry
Recommended Mitigation Steps
Consider dividing
balance
andsupply
by their respective decimals duringentitlement
calculation on LiquidInfrastructureERC20.sol#L275 and properly converting theentitlement
calculation on LiquidInfrastructureERC20.sol#L222-L223Assessed type
Decimal