Function: manage(address _token, uint256 _amount)
The function allows a strategy contract to withdraw a specified amount of a given token. The function performs several checks: ensure that strategy is trusted contract and that the requested amount does not exceed the limit.
Inputs
_tokenControl: Full control by the caller.
Constraints: The
_tokenshould be a trusted strategy token.Impact: Specifies the token that will be transferred from this contract to the caller account.
_amountControl: Full control by the caller.
Constraints: There is a check to ensure that the requested amount does not exceed limits.
Impact: The amount of the token requested by strategy.
Branches and code coverage
Intended branches
Check that tokens have been transferred to the strategy.
Check that
getPortStrategyTokenDebthas been increased.
Negative behavior
Caller is untrusted strategy.
The
_amountis more than the limit.
Function call analysis
SafeTransferLib.safeTransfer(_token, msg.sender, _amount)What is controllable?
_tokenand_amountare controlled by the caller,If the return value is controllable, how is it used and how can it go wrong? There is no return value.
What happens if it reverts, reenters or does other unusual control flow? Function transfers the requested tokens to the strategy contract. If the contract does not have enough tokens, the function call will revert.