Assessment reports>Prisma Finance>Threat Models>offset

Function: offset(IERC20 collateral, uint256 _debtToOffset, uint256 _collToAdd)

Cancel out the specified debt against the debt contained in the stability pool.

Inputs

  • collateral

    • Control: Fully controlled.

    • Constraints: No constraints.

    • Impact: The collateral token used during liquidation to offset.

  • _debtToOffset

    • Control: Fully controlled.

    • Constraints: No constraints.

    • Impact: The debt amount to offset.

  • _collToAdd

    • Control: Fully controlled.

    • Constraints: No constraints.

    • Impact: The total collateral sent to stability pool.

Branches and code coverage (including function calls)

Intended branches

  • Return without updating S and P if debt to offset or total debt is zero.

  • Cancel the liquidated debt with the debt in the stability pool.

  • Update S and P values.

Negative behavior

  • Revert if caller is not liquidation manager.

Zellic © 2025Back to top ↑