sherlock-audit / 2023-12-flatmoney-judging

11 stars 9 forks source link

jennifer37 - Improper handling in function _setMaxDiffPercent() #104

Closed sherlock-admin2 closed 8 months ago

sherlock-admin2 commented 8 months ago

jennifer37

medium

Improper handling in function _setMaxDiffPercent()

Summary

Improper handling in function _setMaxDiffPercent()

Vulnerability Detail

In function _setMaxDiffPercent(), '_maxDiffPercent = 0' means that that we don't ever expect the oracle prices to differ. Zero's one valid value for parameter _maxDiffPercent. However, we will revert if _maxDiffPercent equals 0.

Impact

Function behavior is not expected when _maxDiffPercent equals 0.

Code Snippet

https://github.com/sherlock-audit/2023-12-flatmoney/blob/main/flatcoin-v1/src/OracleModule.sol#L229-L238

Tool used

Manual Review

Recommendation

sherlock-admin commented 8 months ago

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

takarez commented:

invalid

nevillehuang commented 8 months ago

Invalid, valid design decision to not expect two oracle price feeds to continuously have the same price (near impossible). Worse case scenario it can be adjusted to 1 by admin, which achieves similar outcomes.