The primary issue was related to the visibility and encapsulation of these functions, which could potentially impact the contract's security and gas efficiency.
This are both identical functions, the getPenalizedUnderlying
is a getter function and should be public, the _getPenalizedUnderlying
should be private or internal (encapsulated) and called only within the contract.
Public function can be called by anyone on the blockchain leading to various and unexpected manipulation (Price manipulation, supply and demand manipulation, etc..) Thus having two identical functions is also gas inefficient.
Manual review.
I consider this as low because they are both view functions, but I believe two identical public functions (especially when they can show data from other contract/s in the protocol) possibly could lead to various unexpected and creative vulnerabilities, also it is waste of gas.
I consider solution below as best practice, greater security for the protocol and better gas optimization
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.