Skip to content
Request an audit

‹ Findings database

MapleLoan variables read from storage more than once.

Low/InfoMaple Finance audit·Three Sigma·Institutional lending·10th April, 20233S-MAPLE-N01

Description

In the MapleLoan contract, the following variables are loaded from storage multiple times:

  • acceptNewTerms(): lender is loaded twice from storage.
  • acceptNewTerms(): borrower is loaded from storage three times.
  • makePayment(): lender is loaded from storage three times.

Recommendation

These variables should be loaded from storage just once and placed in temporary memory for later use (within the same function).

Status

Addressed in the following PR: https://github.com/maple-labs/open-term-loan-private/pull/48