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
amount
Control: Arbitrary.
Constraints: Must be greater than zero, capped by the reserve cap.
Impact: The amount of funds to deposit.
onBehalfOf
Control: Arbitrary.
Constraints: Nonzero address.
Impact: Address to deposit funds on behalf of.
Branches and code coverage
Intended branches
Invoke the
_deposit
function with the amount andonBehalfOf
address.Increase the reserve amount by the deposited amount to the
onBehalfOf
address.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.