Assessment reports>Origami Finance>Threat Model>transferFrom

Function: transferFrom(address from, address to, uint256 amount)

Available only for minters, so accounts with debt cannot freely transfer debt tokens. Also, minters do not need to have an approve to transfer debt tokens from any accounts. The debt tokens will be removed from the debtor. If the debtor's debt is less than amount, the transaction will revert. At first, the debtor's interest will be covered by amount and the rest of the tokens will decrease the principal. Then, the same amount of debt tokens will be added to the to debtor position, the debtor's principal will be increased by amount, and totalPrincipal will be increased.

Branches and code coverage

Intended branches

  • totalPrincipal was updated properly.

  • The from's principal and interestCheckpoint were updated properly.

  • the to's principal was increased.

Negative behavior

  • Caller is not a minter.

  • from account does not have debt.

  • to is zero address.

  • from is zero address.

  • amount is zero.

Zellic © 2025Back to top ↑