sherlock-audit / 2024-05-sophon-judging

1 stars 1 forks source link

Albort - The function has a logical error in its checks. #221

Closed sherlock-admin4 closed 1 month ago

sherlock-admin4 commented 1 month ago

Albort

high

The function has a logical error in its checks.

Summary

SophonFarming :: setStartBlock ()cannot throw an exception when endBlock is 0

Vulnerability Detail

if (_startBlock == 0 || (endBlock != 0 && _startBlock >= endBlock)) {

Impact

This could lead to unexpected behavior in the contract.

Code Snippet

https://github.com/sherlock-audit/2024-05-sophon/blob/05059e53755f24ae9e3a3bb2996de15df0289a6c/farming-contracts/contracts/farm/SophonFarming.sol#L273

Tool used

Manual Review

Recommendation

if (_startBlock == 0 || _startBlock >= endBlock) {

sherlock-admin2 commented 1 month ago

1 comment(s) were left on this issue during the judging contest.

0xmystery commented:

invalid because of insufficient proof