Function: loop(address asset, uint256 amount, uint256 interestRateMode, uint256 borrowRatio, uint256 loopCount)
Loops the depositing and borrowing.
Inputs
assetControl: Completely controlled by the caller.
Constraints: N/A
Impact: The address of the target token.
amountControl: Completely controlled by the caller.
Constraints: Must have a valid lending pool.
Impact: The total deposit amount.
interestRateModeControl: 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.
borrowRatioControl: Completely controlled by the caller.
Constraints: N/A.
Impact: The percentage of the usage of the borrowed amount.
loopCountControl: 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.