Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

First deposit leads to Vault DOS #214

Closed 0xdcota closed 1 year ago

0xdcota commented 1 year ago

Where: https://github.com/Fujicracy/fuji-v2/blob/3c9c1e2490cf7ba381fc0adc1ff456dba9b6834b/packages/protocol/src/abstracts/BaseVault.sol#L23

Description: Refer to issue described here. TL;DR The function _convertToShares() can be manipulated by depositing very small amount for the initial deposit, thus causing problems for future users (due to rounding errors) for future deposits.

Recommendation;