Extra funds are lost when depositing #42
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
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-02-anchor/blob/7af353e3234837979a19ddc8093dc9ad3c63ab6b/contracts%2Fmoney-market-contracts%2Fcontracts%2Fmarket%2Fsrc%2Fdeposit.rs#L25
https://github.com/code-423n4/2022-02-anchor/blob/7af353e3234837979a19ddc8093dc9ad3c63ab6b/contracts%2Fmoney-market-contracts%2Fcontracts%2Fmarket%2Fsrc%2Fborrow.rs#L126
Vulnerability details
Impact
The money market functions only work on a single native token (
info.funds
) but don't revert if other native tokens are provided.Users that call these functions with different funds are losing their funds.
Recommended Mitigation Steps
In addition, check that the
info.funds
has length 1.The text was updated successfully, but these errors were encountered: