Function: processDepositQueue(address vaultAddress, uint256 maxProcessCount)
Processes deposits that are currently in the deposit queue.
Inputs
vaultAddress
Control: Fully controlled.
Constraints: This vault's status must be set to
DepositsOpen
.Impact: Deposits are processed for this vault.
maxProcessCount
Control: Fully controlled.
Constraints: Used as a loop counter, therefore must not cause the call to exceed gas limits.
Impact: Used to constrain the amount of gas used by this function.
Branches and code coverage (including function calls)
Intended branches
Should update relevant
FCNProduct
storage variables correctly.Should update relevant vault metadata properties correctly.
Should still allow for more deposits to be processed if the entire deposit queue is not processed after one call.
Should set the vault's status to
NotTraded
if the entire deposit queue is processed.Should emit a
DepositQueueProcessed
event.
Negative behaviour
Should revert if the vault's status it not set to
DepositsOpen
.Should revert if called by a non--trader-admin role.
Should revert if the vault is in the
Zombie
state.
Function call analysis
vault.deposit(deposit.amount, deposit.receiver)
What is controllable? deposit.amount, deposit.receiver.
If return value controllable, how is it used and how can it go wrong? N/A.
What happens if it reverts, reenters, or does other unusual control flow? Denial of service on revert, as processing the deposit queue is crucial to the functionality of this contract. Deposits may be accounted for twice on reentry, and some deposits will not be accounted for at all in that scenario.