20,000 USDC
View results
Submission Details
Severity: medium

malicious user can block other users interacting with the contract..

Summary

unnecessary gas and blockchain resources, leading to increased fees for all users interacting with the contract.

Vulnerability Details

Under Staking.deposit, their is no check for input validation therefore allowing zero amount deposits could be exploited by malicious users to spam the contract with empty transactions. This could potentially consume unnecessary gas and blockchain resources, leading to increased fees for all users interacting with the contract.

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Staking.sol#L38

function deposit(uint _amount) external {
TKN.transferFrom(msg.sender, address(this), _amount);
updateFor(msg.sender);
balances[msg.sender] += _amount;
}

Impact

Other users unable to interact with the contract on excess gas consumption..

Tools Used

Recommendations

Put an input validation check.

Support

FAQs

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