The deposit() function correctly implements the nonReentrant modifier, which prevents direct reentrancy attacks. However, state variables are updated after an external call (safeTransferFrom().
The function makes an external call to collateralToken.safeTransferFrom(), an then update state variables (depositInfo[counter] and totalDepositAmount).
State inconsistency: If safeTransferFrom() fails unexpectedly, the function's logic may break, leaving the contract in an unintended state.
Potential loss of funds: If the contract depends on the correct sequence of state updates and external calls, a failure in safeTransferFrom() could cause desynchronization.
Manual review
Update state variables first before making external calls.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.