Function: deposit(uint256 amount, address onBehalfOf)
This function is used to deposit funds into the contract. The funds are then used to create a new pool after the deposit period ends. The user can deposit on behalf of another address.
Inputs
amountControl: Arbitrary.
Constraints: Must be greater than zero, capped by the reserve cap.
Impact: The amount of funds to deposit.
onBehalfOfControl: Arbitrary.
Constraints: Nonzero address.
Impact: Address to deposit funds on behalf of.
Branches and code coverage
Intended branches
Invoke the
_depositfunction with the amount andonBehalfOfaddress.Increase the reserve amount by the deposited amount to the
onBehalfOfaddress.Transfer the amount of tokens from the sender to the contract.
Negative behavior
Revert if the deposit period has not started.
Revert if the deposit period has ended.
Revert if the reserve cap has been reached.
Revert if the contract is paused.
Revert if this function is called in a reentrant manner.