Function: withdraw(address token, uint256 amount)
This function allows the InfiniCard Vault to withdraw a specified amount of the token from the strategy vault.
Inputs
tokenControl: Controlled by the caller with
INFINI_CARD_VAULT.Constraints: None.
Impact: The token to withdraw.
amountControl: Controlled by the caller with
INFINI_CARD_VAULT.Constraints: None.
Impact: The amount of tokens to withdraw.
Branches and code coverage
Intended branches
Retrieves the vault's balance of the token.
Sets
actualAmounttovaultBalanceif the vault's balance is smaller than the amount; otherwise, it setsactualAmounttoamount.Transfers the
actualAmountof tokens from the vault.
Negative behavior
Reverts if the caller does not have the
INFINI_CARD_VAULTrole.