code-423n4 / 2021-12-amun-findings

0 stars 0 forks source link

Call function internally instead of externally #270

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

Czar102

Vulnerability details

Impact

To save gas it is recommended it call function internally, if possible.

Proof of Concept

Function BasketFacet::getLock() is defined externally and calls from BasketFacet::joinPool(...) and BasketFacet::exitPool(...) are not internal, but message calls.

The same applies to function BasketFacet::getCap() usage in BasketFacet::joinPool(...).

Recommended Mitigation Steps

Consider changing visibility of BasketFacet::getLock() to public and calling the above function internally. Alternative solution shall be implemented with BasketFacet::getCap().