Function: deposit(uint256 side)
This function divides into FIXED and VARIABLE to deposit. In FIXED, mint claim tokens and ETHDepositTokens. In VARIABLE, mint bearer tokens.
Inputs
sideControl: Arbitrary.
Constraints: It is expected
FIXEDorVARIABLEvalue.Impact: The value of side.
Branches and code coverage
Intended branches
Amount is not zero.
isStarted()is not set.Side is divided into
FIXEDandVARIABLE.
Negative behavior
Reverts if the
fixedSideCapacityis zero.Reverts if the
!isStarted()is not zero.Reverts if the
sideis notFIXEDorVARIABLE.Reverts if the
msg.valueis smaller thanminimumDepositAmount.Reverts if the
amountis smaller thanminimumFixedDeposit.Reverts if the
amountis larger thanfixedSideCapacity - fixedETHDepositTokenTotalSupply.Reverts if the
remainingCapacityis smaller thanminimumFixedDepositand not zero.Reverts if the
sharesis smaller than one.Reverts if the
stETHReceivedis smaller thanamountandamount - stETHReceivedis larger thanLIDO_ERROR_TOLERANCE_ETH.Reverts if the
amountis larger thanvariableSideCapacity - variableBearerTokenTotalSupply.Reverts if the
remainingCapacityis smaller thanminimumDepositAmountand not zero.
Function call analysis
Math.mulDiv(this.fixedSideCapacity, this.minimumFixedDepositBps, 10000)What is controllable? None.
If the return value is controllable, how is it used and how can it go wrong? None.
What happens if it reverts, reenters or does other unusual control flow? N/A.
this.stakingBalance() -> LidoVault.lido.balanceOf(address(this))What is controllable? None.
If the return value is controllable, how is it used and how can it go wrong? None.
What happens if it reverts, reenters or does other unusual control flow? N/A.
LidoVault.lido.submit{value: amount}What is controllable?
amount.If the return value is controllable, how is it used and how can it go wrong? None.
What happens if it reverts, reenters or does other unusual control flow? It can be misused. It is caused reentrancy.