The impact of this finding is more on the marketing/data fetching side, on exchanges it would appear that the shares are worth less VIRTUAL_SHARES than the underlying token. Given that it would influence the perception of the value of the shares token, medium severity seems appropriate.
Proof of Concept
The Openzeppelin implementation includes the decimals offset (log10(VIRTUAL_SHARES) in LendingPool) in the decimals() function. However, INIT only places the decimals of the underlying.
Lines of code
https://github.com/code-423n4/2023-12-initcapital/blob/main/contracts/lending_pool/LendingPool.sol#L95-L97
Vulnerability details
Impact
The impact of this finding is more on the marketing/data fetching side, on exchanges it would appear that the shares are worth less VIRTUAL_SHARES than the underlying token. Given that it would influence the perception of the value of the shares token, medium severity seems appropriate.
Proof of Concept
The Openzeppelin implementation includes the decimals offset (log10(
VIRTUAL_SHARES
) in LendingPool) in thedecimals()
function. However, INIT only places the decimals of the underlying.A POC was built, add it to
TestLendingPool.sol
:Tools Used
Vscode, Foundry
Recommended Mitigation Steps
Include the virtual shares decimals in the
decimals()
function:Assessed type
ERC20