20,000 USDC
View results
Submission Details
Severity: gas

Staking.sol#claim() - double assignment of balance wastes gas

Gas - the function claim() used for claiming rewards calls the updateFor() which calls update(), which has 2 possible scenarios - the current WETH balance is equal to the balance variable no change, or the current WETH balance is bigger than the balance variable in which case we reassign it the current value. The line provided in the link does not change the balance in both cases and can be removed.

Support

FAQs

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