Assessment reports>Origami Finance>Threat Model>deposit

Function: deposit(uint256 amount)

Allows SupplyManager to deposit asset tokens. These tokens will be allocated to the trusted strategy contract, and the appropriate amount of debtToken tokens will be minted for IdleStrategyManager.

Inputs

  • amount

    • Constraints: No constraints.

    • Impact: The amount to deposit.

Branches and code coverage

Intended branches

  • The deposit was executed properly.

Negative behavior

  • Caller is not SupplyManager.

Function call analysis

  • asset.safeTransferFrom(msg.sender, address(this), amount)

    • What is controllable? amount.

    • If the return value is controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters or does other unusual control flow? Transfer invested assets from SupplyManager to this contract. Can revert if callers do not own enough asset tokens, but this is unlikely, since previous contracts in the call chain verify that enough tokens have been provided by the user.

  • idleStrategyManager.allocate(amount)

    • What is controllable? amount.

    • If the return value is controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters or does other unusual control flow? Transfer asset tokens from this contract to IdleStrategyManager contract.

  • debtToken.mint(address(idleStrategyManager), amount.scaleUp(_assetScalar))

    • What is controllable? amount.

    • If the return value is controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters or does other unusual control flow? No problem.

Zellic © 2025Back to top ↑