Description:Description\
There are several investment options available to users:
Users can invest directly into the OvUSDCvault using the oUSDC token.
Users can invest directly into the OvUSDCvault using the USDC token through the SupplyManager.
Users can invest using the USDC token and receive oUSDC tokens in return.
In the last case, the oUSDC tokens held by the user are not automatically invested in the OvUSDCvault.
But the invested USDC tokens which are related to these oUSDC tokens also earns interest.
To receive accrued interest, users must invest these oUSDC tokens into the OvUSDCvault.
In some cases, users may be unable to invest in the OvUSDC vault due to the calculated share becoming 0.
Attack Scenario\
User A invests USDC tokens and receives oUSDC tokens in OrigamiOToken.
(Maybe the interest can be added after User A deposits 1 oUSDC token. i.e. the order is not important)
User B wants to invest to OvUSDCvault.
If User B's investment amount is smaller than the current total reserves in the OvUSDC vault, User B will receive 0 shares.
Github username: -- Twitter username: -- Submission hash (on-chain): 0x62e91209f206313db4ba5e094cc4307656c0e164e8a5c6796109b6ffb2e0acf2 Severity: medium
Description: Description\ There are several
investment
options available tousers
:invest
directly into theOvUSDC
vault
using theoUSDC
token.invest
directly into theOvUSDC
vault
using theUSDC
token through theSupplyManager
.invest
using theUSDC
token and receiveoUSDC
tokens in return. In the last case, theoUSDC
tokens held by theuser
are not automaticallyinvested
in theOvUSDC
vault
. But the investedUSDC
tokens which are related to theseoUSDC
tokens also earnsinterest
. To receive accruedinterest
,users
mustinvest
theseoUSDC
tokens into theOvUSDC
vault
. In some cases, users may be unable toinvest
in theOvUSDC
vault due to the calculatedshare
becoming0
.Attack Scenario\
User A
investsUSDC
tokens and receivesoUSDC
tokens inOrigamiOToken
.The invested
USDC
tokens earn someinterest
, and theseinterests
are added to theOvUSDC
vault
.User A
invests exactly1 oUSDC
token into theOvUSDC vault
.He will receive
1
share
because thetotalSupply
is0
at this point.(Maybe the
interest
can be added afterUser A
deposits1 oUSDC
token. i.e. the order is not important)User B
wants toinvest
toOvUSDC
vault
. IfUser B
'sinvestment
amount is smaller than thecurrent total reserves
in theOvUSDC vault
,User B
will receive0 shares
.And this transaction will be reverted.
Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)
Limit the deposit size for the initial
depositor
.