RioLRTCoordinator
Inherits: IRioLRTCoordinator, OwnableUpgradeable, UUPSUpgradeable, PausableUpgradeable, EIP712, RioLRTCore
State Variables
DEPOSIT_ROOT_TYPEHASH
EIP-712 typehash for DepositRoot
message
ethPOS
The Ethereum POS deposit contract address.
rebalanceDelay
The required delay between rebalances.
guardianSigner
The guardian signer address.
assetNextRebalanceAfter
Tracks the timestamp from which each asset is eligible for rebalancing, inclusive of the defined timestamp.
Functions
checkDeposit
Require that the coordinator is not paused, the asset is supported, the deposit amount is non-zero, and the deposit cap has not been reached.
Parameters
checkWithdrawal
Require that the coordinator is not paused, the asset is supported, and the withdrawal amount is non-zero.
Parameters
checkRebalance
Require that the coordinator is not paused and the rebalance delay has been met.
Parameters
constructor
Parameters
initialize
Initializes the contract.
Parameters
getTVL
Returns the total value of all underlying assets in the unit of account.
depositERC20
Deposits ERC20 tokens and mints restaking token(s) to the caller.
Reentrancy protection is omitted as tokens with transfer hooks are not supported. Future inclusion of such tokens could risk reentrancy attacks. Developers should remain vigilant and consider safeguards if this assumption changes.
Parameters
depositETH
Deposits ETH and mints restaking token(s) to the caller.
requestWithdrawal
Requests a withdrawal to asset
for amountIn
restaking tokens.
Parameters
rebalanceETH
Rebalances ETH by processing outstanding withdrawals and depositing remaining ETH into EigenLayer.
This function requires a guardian signature prior to depositing ETH into EigenLayer. If the guardian doesn't provide a signature within 24 hours, then the rebalance will be allowed without a signature, but only for withdrawals. In the future, this may be extended to allow a rebalance without a guardian signature without waiting 24 hours if withdrawals outnumber deposits.
Parameters
rebalanceERC20
Rebalances the provided ERC20 token
by processing outstanding withdrawals and depositing remaining tokens into EigenLayer.
Parameters
setRebalanceDelay
Sets the rebalance delay.
Parameters
setGuardianSigner
Set the guardian signer address.
Only callable by the owner.
Parameters
emergencyPauseOperatorUndelegated
Pauses the coordinator if any operator has forcefully undelegated one of our delegators.
Anyone can call this function.
pause
Pauses deposits, withdrawals, and rebalances.
unpause
Unpauses deposits, withdrawals, and rebalances.
convertFromUnitOfAccountToRestakingTokens
Converts the unit of account value to its equivalent in restaking tokens. The unit of account is the price feed's quote asset.
Parameters
convertToUnitOfAccountFromRestakingTokens
Converts an amount of restaking tokens to its equivalent value in the unit of account. The unit of account is the price feed's quote asset.
Parameters
convertFromAssetToRestakingTokens
Converts an asset amount to its equivalent value in restaking tokens.
Parameters
convertToAssetFromRestakingTokens
Converts an amount of restaking tokens to the equivalent in the asset.
Parameters
convertToSharesFromRestakingTokens
Converts an amount of restaking tokens to the equivalent in the provided asset's EigenLayer shares.
Parameters
hashTypedData
EIP-712 helper.
Parameters
receive
Deposits ETH and mints restaking token(s) to the caller.
_depositETH
Deposits ETH and mints restaking token(s) to the caller.
This function assumes that the quote asset is ETH.
_setRebalanceDelay
Sets the rebalance delay.
Parameters
_processUserWithdrawalsForCurrentEpoch
Processes user withdrawals for the provided asset by transferring available assets from the deposit pool and queueing any remaining amount for withdrawal from EigenLayer.
Parameters
_domainNameAndVersion
Returns the domain name and version for EIP-712 guardian signatures.
_verifyGuardianSignature
Verify EIP-712 DepositDataRoot
signature.
Parameters
_requireAssetSupported
Reverts if the asset is not supported.
Parameters
_requireAmountGreaterThanZero
Reverts if the provided amount is zero.
Parameters
_requireDepositCapNotReached
Reverts if the deposit cap for the asset has been reached.
Parameters
_requireRebalanceDelayMet
Reverts if the rebalance delay has not been met.
Parameters
_authorizeUpgrade
Allows the owner to upgrade the gateway implementation.
Parameters
Last updated