20,000 USDC
View results
Submission Details
Severity: medium

Does not follow CEI pattern

Summary

Vulnerability Details

The contract's function does not follow the CEI pattern. Transfer (Interaction) is made before state change (Effect).

Impact

The claim() function in the staking contract does not follow the CEI pattern. Not following CEI can lead to critical issues in the contract resulting in disastrous losses. Though the function does not result in a vulnerability capable of causing loss; It's still recommended to follow the CEI pattern to avoid any unexpected issues.

Tools Used

Manual Review.

Recommendations

Follow the CEI pattern.

function claim() external {
updateFor(msg.sender);
claimable[msg.sender] = 0;
WETH.transfer(msg.sender, claimable[msg.sender]);
balance = WETH.balanceOf(address(this));
}

Support

FAQs

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