Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 1.03 KB

Remove unnecessary call to `DAOfiV1Factory.formula()`.md

File metadata and controls

23 lines (20 loc) · 1.03 KB

The DAOfiV1Pair functions initialize(), getBaseOut(), and getQuoteOut() all use the private function _getFormula(), which makes a call to the factory to retrieve the address of the BancorFormula contract.

The formula address in the factory is set in the constructor and cannot be changed, so these calls can be replaced with an immutable value in the pair contract that is set in its constructor.

Recommendation:

Remove unnecessary calls


Slide Screenshot

110.jpg


Slide Text

  • ConsenSys Audit DAfi Finding 3.2
  • Unnecessary Code/Logic
  • Getter Function for Immutable Address
  • Replace Function Call w/ Variable Read

References


Tags