Skip to content

S1: General Improvements #241

Description

@liobrasil

Auditor Suggestion

Files Affected

  • cadence/contracts/FlowALPv1.cdc

Description

  • Brittle handling of interestCurve types in updateInterestRates(), else branch is missing type check.
  • Duplicate balance sheet construction in various functions.
  • Use view.trueBalance() helper in healthFactor().
  • The Pool.isLiquidatable() panics for invalid pid values.
  • Pool.createPosition() is missing type checks for connectors.
  • Missing input validation in Pool.setDexOracleDeviationBps().
  • Missing events for some setters, e.g. setMinimumTokenBalancePerPosition().
  • Consider setting custom target and max health during position creation to improve the one-step borrowing process.
  • liquidate_via_dex.cdc and liquidate_via_mock_dex.cdc transactions use deprecated functions.
  • LiquidationExecutedViaDex event is not used.
  • Consider validating that estimationMargin >= 1.0. feeWithMargin is meant to be a safety buffer over the estimated scheduler fee, so if estimationMargin < 1.0 it reduces the fee and can cause scheduling attempts with insufficient fees (even when minimumAvailable is healthy).

Recommendation

Address the listed improvements across validation, events, and robustness.


Parent Issue: #209

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions