Function: withdraw(uint256 amount)
This function is used to withdraw funds from the contract. The funds are then transferred back to the user.
Inputs
amount
Control: Arbitrary.
Constraints: Must be greater than zero and less than the user's balance.
Impact: The amount of funds to withdraw.
Branches and code coverage
Intended branches
Subtract the amount from the user's balance.
Transfer the amount of tokens from the contract to the user.
Negative behavior
Revert if the deposit period has not started.
Revert if the deposit period has ended.
Revert if the user's balance is less than the amount to withdraw.
Revert if this function is called in a reentrant manner.