safeConcurTransfer
can cause loss of funds
#244
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
Lines of code
https://github.com/code-423n4/2022-02-concur/blob/main/contracts/MasterChef.sol#L201-L211
Vulnerability details
Impact
All calculations are rounded down, since a lack of tokens in the contracts cannot be rounding errors' fault. So the function is redundant.
On the other hand, if the contract is undersupplied with Concur tokens, this will cause depositors to be sent less tokens than needed (or none). This is especially unsafe because the tokens that were lacking are not resembled in accountings at all. Thus a depositor may invoke the
safeConcurTransfer
and not receive tokens they were supposed to.Tools Used
Manual analysis
Recommended Mitigation Steps
Use usual
safeTransfer
instead ofsafeConcurTransfer
.The text was updated successfully, but these errors were encountered: