The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Code does not follow the best practice of check-effects-interaction

Summary

Code should follow the best-practice of check-effects-interaction, where state variables are updated before any external calls are made.

Vulnerability Details

File: contracts/LiquidationPool.sol
/// @audit - State change after external call: `IERC20(TST).safeTransfer(msg.sender, _tstVal)`
155: positions[msg.sender].TST -= _tstVal
/// @audit - State change after external call: `IERC20(EUROs).safeTransferFrom(msg.sender, address(this), _amount)`
188: positions[_holder].EUROs += _amount * positions[_holder].TST / tstTotal

Tools Used

VSCode

Recommendations

Rewrite the code to follow the CEI pattern

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.