Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.54 KB

Missing zero-address checks in `Curve.transferOwnership` and `Router.constructor`.md

File metadata and controls

33 lines (25 loc) · 1.54 KB

Like other similar functions, Curve.transfer and Orchestrator.includeAsset perform zero-address checks.

However, Curve.transferOwnership and the Router constructor do not.

This may make sense for Curve.transferOwnership, because without zero-address checks, the function may serve as a means of burning ownership.

However, popular contracts that define similar functions often consider this case, such as OpenZeppelin's Ownable contracts.

Conversely, a zero-address check should be added to the Router constructor to prevent the deployment of an invalid Router, which would revert upon a call to the zero address.

Recommendation:

Short term, consider adding zero-address checks to the Router's constructor and Curve's transferOwnership function to prevent operator errors.

Long term, review state variables which referencing contracts to ensure that the code that sets the state variables performs zero-address checks where necessary


Slide Screenshot

146.jpg


Slide Text

  • ToB Audit DFX Finance Finding 4
  • Data Validation
  • Missing Checks Zero-address
  • Add Checks
  • Best-practice

References


Tags