20,000 USDC
View results
Submission Details
Severity: high

Staking.sol#L53 : Re-entrancy problem in claim call

Summary

During claim call, the state update is done after making the transaction. this will lead to re-entrancy problem.

Vulnerability Details

function claim() external {
updateFor(msg.sender);
WETH.transfer(msg.sender, claimable[msg.sender]); --------->> transfer is done first.
claimable[msg.sender] = 0; --------------------------------->> state updated second
balance = WETH.balanceOf(address(this));
}

As shown in above code snip, claim call is updating the state update making the transaction.

Impact

Loss of funds.

Tools Used

Manual review.

Recommendations

function claim() external {
updateFor(msg.sender);
uint value = claimable[msg.sender] ;---------- +++
laimable[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.