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
side
Control: Arbitrary.
Constraints: It is expected
FIXED
orVARIABLE
value.Impact: The value of side.
Branches and code coverage
Intended branches
Amount is not zero.
isStarted()
is not set.Side is divided into
FIXED
andVARIABLE
.
Negative behavior
Reverts if the
fixedSideCapacity
is zero.Reverts if the
!isStarted()
is not zero.Reverts if the
side
is notFIXED
orVARIABLE
.Reverts if the
msg.value
is smaller thanminimumDepositAmount
.Reverts if the
amount
is smaller thanminimumFixedDeposit
.Reverts if the
amount
is larger thanfixedSideCapacity - fixedETHDepositTokenTotalSupply
.Reverts if the
remainingCapacity
is smaller thanminimumFixedDeposit
and not zero.Reverts if the
shares
is smaller than one.Reverts if the
stETHReceived
is smaller thanamount
andamount - stETHReceived
is larger thanLIDO_ERROR_TOLERANCE_ETH
.Reverts if the
amount
is larger thanvariableSideCapacity - variableBearerTokenTotalSupply
.Reverts if the
remainingCapacity
is smaller thanminimumDepositAmount
and 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.