Vault:deposit
should transfer the amount assets
and not shares
.
#78
Labels
bug
Something isn't working
old-submission-method
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2022-09-y2k-finance/blob/2175c044af98509261e4147edeb48e1036773771/src/Vault.sol#L167
Vulnerability details
Impact
The wrong amount can be transferred from the
msg.sender
to theVault
.Proof of Concept
When
Vault:deposit
is called, it is supposed to getassets
amount ofasset
from themsg.sender
and send themsg.sender
shares
amount of the vault token.However in the current implementation, the
Vault
would getshares
amount ofasset
from themsg.sender
. See line 167 from the snippet below.The
assets
andshares
are not necessarily the same amount. Therefore theVault
might transfer the wrong amount ofasset
from themsg.sender
.Tools Used
None
Recommended Mitigation Steps
The text was updated successfully, but these errors were encountered: