Fujicracy / fuji-v2

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

CS - CompoundV2 Incorrect calculation of deposit balance #183

Closed 0xdcota closed 1 year ago

0xdcota commented 1 year ago

Where: https://github.com/Fujicracy/fuji-v2/blob/ab02d2308797577973ac358af8c7aadf973bcec7/packages/protocol/src/providers/mainnet/CompoundV2.sol#L181

Description: The amount of total assets in the vault is retrieved with a call to the getDepositBalance on the provider contract. However, the getDepositBalance returns a value that is not the same as the user has deposited and transferred to the vault in the first deposit.

Recommendation: • Fix the calculation formula for the totalAssets function of CompoundV2 provider.