Function: loop(address asset, uint256 amount, uint256 interestRateMode, uint256 borrowRatio, uint256 loopCount)
Loops the depositing and borrowing.
Inputs
asset
Control: Completely controlled by the caller.
Constraints: N/A
Impact: The address of the target token.
amount
Control: Completely controlled by the caller.
Constraints: Must have a valid lending pool.
Impact: The total deposit amount.
interestRateMode
Control: Completely controlled by the caller.
Constraints: N/A.
Impact: The interest-rate mode at which the user wants to borrow: 1 for stable, 2 for variable.
borrowRatio
Control: Completely controlled by the caller.
Constraints: N/A.
Impact: The percentage of the usage of the borrowed amount.
loopCount
Control: Completely controlled by the caller.
Constraints:
loopCount >= 2 && loopCount <= 40
.Impact: The loop count for how many times to deposit
Branches and code coverage (including function calls)
Intended branches
Succeeds if user has sufficient balance.
Asset balance of the contract is zero after success.
Negative behavior
Reverts if user does not have sufficient balance.