Function: _leverage(address sender, uint256 _amount)
This leverages a position.
Inputs
senderControl: Full.
Constraints: None.
Impact: The
msg.senderfrom market.
_amountControl: Full.
Constraints: None.
Impact: The amount to leverage.
Branches and code coverage (including function calls)
Intended branches
Leverages the user's position.
Negative behavior
Zero/boundary checks.
Function call analysis
_leverage -> asset_.balanceOfWhat is controllable? Everything.
If return value controllable, how is it used and how can it go wrong? Initial amount of asset.
What happens if it reverts, reenters, or does other unusual control flow? N/A.
_leverage -> market.credit().borrowForCollateral(amount, sender)What is controllable? Everything.
If return value controllable, how is it used and how can it go wrong? Discarded.
What happens if it reverts, reenters, or does other unusual control flow? N/A.
_leverage -> asset_.balanceOfWhat is controllable? Everything.
If return value controllable, how is it used and how can it go wrong? Post amount of asset.
What happens if it reverts, reenters, or does other unusual control flow? N/A.
_leverage -> _mint(nothing)What is controllable? Everything.
If return value controllable, how is it used and how can it go wrong? Discarded.
What happens if it reverts, reenters, or does other unusual control flow? N/A.