Assessment reports>Wasabi Perps>Threat Model>computeMaxInterest

Function: computeMaxInterest(address, uint256 _principal, uint256 _lastFundingTimestamp)

This function computes the maximum interest amount to pay for the loan.

Inputs

  • <unnamed@0>

    • Impact: Unused.

  • _principal

    • Control: Full control.

    • Constraints: None.

    • Impact: The principal borrowed.

  • _lastFundingTimestamp

    • Control: Full control.

    • Constraints: Must be lower than the current block.timestamp.

    • Impact: The timestamp where the loan was last funded.

Branches and code coverage

Intended branches

  • Calculates the right maximum interest amount to pay for the loan.

Negative behavior

  • Revert if _lastFundingTimestamp is bigger than block.timestamp.

  • Revert if maxInterestToPay is lower than 0.

Zellic © 2024Back to top ↑