IStrategyManager
Author: Layr Labs, Inc.
Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service
See the StrategyManager
contract itself for implementation details.
Functions
depositIntoStrategy
Deposits amount
of token
into the specified strategy
, with the resultant shares credited to msg.sender
The msg.sender
must have previously approved this contract to transfer at least amount
of token
on their behalf.
Cannot be called by an address that is 'frozen' (this function will revert if the msg.sender
is frozen). WARNING: Depositing tokens that allow reentrancy (eg. ERC-777) into a strategy is not recommended. This can lead to attack vectors where the token balance and corresponding strategy shares are not in sync upon reentrancy.
Parameters
strategy
address
is the specified strategy where deposit is to be made,
token
address
is the denomination in which the deposit is to be made,
amount
uint256
is the amount of token to be deposited in the strategy by the staker
Returns
shares
uint256
The amount of new shares in the strategy
created as part of the action.
depositIntoStrategyWithSignature
Used for depositing an asset into the specified strategy with the resultant shares credited to staker
, who must sign off on the action. Note that the assets are transferred out/from the msg.sender
, not from the staker
; this function is explicitly designed purely to help one address deposit 'for' another.
The msg.sender
must have previously approved this contract to transfer at least amount
of token
on their behalf.
A signature is required for this function to eliminate the possibility of griefing attacks, specifically those targeting stakers who may be attempting to undelegate.
Cannot be called on behalf of a staker that is 'frozen' (this function will revert if the staker
is frozen). WARNING: Depositing tokens that allow reentrancy (eg. ERC-777) into a strategy is not recommended. This can lead to attack vectors where the token balance and corresponding strategy shares are not in sync upon reentrancy
Parameters
strategy
IStrategy
is the specified strategy where deposit is to be made,
token
IERC20
is the denomination in which the deposit is to be made,
amount
uint256
is the amount of token to be deposited in the strategy by the staker
staker
address
the staker that the deposited assets will be credited to
expiry
uint256
the timestamp at which the signature expires
signature
bytes
is a valid signature from the staker
. either an ECDSA signature if the staker
is an EOA, or data to forward following EIP-1271 if the staker
is a contract
Returns
shares
uint256
The amount of new shares in the strategy
created as part of the action.
removeShares
Used by the DelegationManager to remove a Staker's shares from a particular strategy when entering the withdrawal queue
addShares
Used by the DelegationManager to award a Staker some shares that have passed through the withdrawal queue
withdrawSharesAsTokens
Used by the DelegationManager to convert withdrawn shares to tokens and send them to a recipient
stakerStrategyShares
Returns the current shares of user
in strategy
getDeposits
Get all details on the staker's deposits and corresponding shares
Returns
<none>
IStrategy[]
(staker's strategies, shares in these strategies)
<none>
uint256[]
stakerStrategyListLength
Simple getter function that returns stakerStrategyList[staker].length
.
addStrategiesToDepositWhitelist
Owner-only function that adds the provided Strategies to the 'whitelist' of strategies that stakers can deposit into
Parameters
strategiesToWhitelist
address[]
Strategies that will be added to the strategyIsWhitelistedForDeposit
mapping (if they aren't in it already)
removeStrategiesFromDepositWhitelist
Owner-only function that removes the provided Strategies from the 'whitelist' of strategies that stakers can deposit into
Parameters
strategiesToRemoveFromWhitelist
IStrategy[]
Strategies that will be removed to the strategyIsWhitelistedForDeposit
mapping (if they are in it)
delegation
Returns the single, central Delegation contract of EigenLayer
slasher
Returns the single, central Slasher contract of EigenLayer
eigenPodManager
Returns the EigenPodManager contract of EigenLayer
migrateQueuedWithdrawal
calculateWithdrawalRoot
Events
Deposit
Emitted when a new deposit occurs on behalf of staker
.
Parameters
staker
address
Is the staker who is depositing funds into EigenLayer.
token
IERC20
Is the token that staker
deposited.
strategy
IStrategy
Is the strategy that staker
has deposited into.
shares
uint256
Is the number of new shares staker
has been granted in strategy
.
StrategyWhitelisterChanged
Emitted when the strategyWhitelister
is changed
StrategyAddedToDepositWhitelist
Emitted when a strategy is added to the approved list of strategies for deposit
StrategyRemovedFromDepositWhitelist
Emitted when a strategy is removed from the approved list of strategies for deposit
Structs
DeprecatedStruct_WithdrawerAndNonce
DeprecatedStruct_QueuedWithdrawal
Struct type used to specify an existing queued withdrawal. Rather than storing the entire struct, only a hash is stored. In functions that operate on existing queued withdrawals -- e.g. startQueuedWithdrawalWaitingPeriod
or completeQueuedWithdrawal
, the data is resubmitted and the hash of the submitted data is computed by calculateWithdrawalRoot
and checked against the stored hash in order to confirm the integrity of the submitted data.
Last updated