sherlock-audit / 2023-12-dodo-gsp-judging

6 stars 5 forks source link

bareli - Wrong implementation:_K_ should be greater than 0. #117

Closed sherlock-admin2 closed 9 months ago

sherlock-admin2 commented 9 months ago

bareli

medium

Wrong implementation:K should be greater than 0.

Summary

There is wrong implementation of K as it in the comment it is shown it should be greater than 0. but we have implemented that it can be 0.

Vulnerability Detail

k should be greater than 0 and less than 1018 as it is shown in the comment. require(k <= 1018); K = k;

here K can be less than 0;

Impact

Code Snippet

https://github.com/sherlock-audit/2023-12-dodo-gsp/blob/main/dodo-gassaving-pool/contracts/GasSavingPool/impl/GSP.sol#L58 require(k <= 10**18);

Tool used

Manual Review

Recommendation

require(k > 0 && k<= 10**36);

Duplicate of #76