Source Code Docs

IUltraLRT

hasRole

function hasRole(bytes32 role, address user) external view returns (bool)

HARVESTER

function HARVESTER() external view returns (bytes32)

AffineDelegator

Delegator contract for stETH on Eigenlayer

vault

address vault

asset

contract ERC20 asset

onlyVaultOrHarvester

modifier onlyVaultOrHarvester()

Modifier to allow function calls only from the vault or harvester

onlyVault

modifier onlyVault()

Modifier to allow function calls only from the vault

onlyHarvester

modifier onlyHarvester()

Modifier to allow function calls only from the harvester

delegate

function delegate(uint256 amount) external

Delegate & restake stETH to operator

_delegate

function _delegate(uint256 amount) internal virtual

Delegate stETH to operator

requestWithdrawal

function requestWithdrawal(uint256 assets) external

Request withdrawal from eigenlayer

Request withdrawal from eigenlayer

Parameters

_requestWithdrawal

function _requestWithdrawal(uint256 assets) internal virtual

Request withdrawal from eigenlayer

withdraw

function withdraw() external virtual

Withdraw stETH from delegator to vault

totalLockedValue

function totalLockedValue() public view virtual returns (uint256)

Get total locked value

Return Values

withdrawableAssets

function withdrawableAssets() public view virtual returns (uint256)

Get withdrawable assets

Return Values

queuedAssets

function queuedAssets() public view virtual returns (uint256)

Get queued assets

Return Values

AffineReStaking

initialize

function initialize(address _governance, address _weth) external

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

_Function that should revert when msg.sender is not authorized to upgrade the contract. Called by {upgradeTo} and {upgradeToAndCall}.

Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.

function _authorizeUpgrade(address) internal override onlyOwner {}
```_

### GUARDIAN_ROLE

```solidity
bytes32 GUARDIAN_ROLE

APPROVED_TOKEN

bytes32 APPROVED_TOKEN

WETH

contract IWETH WETH

balance

mapping(address => mapping(address => uint256)) balance

depositPaused

uint256 depositPaused

whenDepositNotPaused

modifier whenDepositNotPaused()

pauseDeposit

function pauseDeposit() external

resumeDeposit

function resumeDeposit() external

approveToken

function approveToken(address _token) external

revokeToken

function revokeToken(address _token) external

Deposit

event Deposit(uint256 eventId, address depositor, address token, uint256 amount)

depositFor

function depositFor(address _token, address _for, uint256 _amount) external

depositETHFor

function depositETHFor(address _for) external payable

Withdraw

event Withdraw(uint256 eventId, address withdrawer, address token, uint256 amount)

withdraw

function withdraw(address _token, uint256 _amount) external

pause

function pause() external

Pause the contract

unpause

function unpause() external

Unpause the contract

IDelegatorBeacon

owner

function owner() external returns (address)

DelegatorBeacon

Delegator Beacon contract

beacon

contract UpgradeableBeacon beacon

blueprint

address blueprint

constructor

constructor(address _initBlueprint, address governance) public

Constructor

Parameters

update

function update(address _newBlueprint) public

Update the blueprint

Parameters

implementation

function implementation() public view returns (address)

Get the implementation address

Return Values

IDelegatorFactory

createDelegator

function createDelegator(address _operator) external returns (address)

vault

function vault() external returns (address)

DelegatorFactory

Delegator Factory contract

vault

address vault

onlyVault

modifier onlyVault()

Modifier to allow function calls only from the vault

constructor

constructor(address _vault) public

Constructor

Parameters

createDelegator

function createDelegator(address _operator) external returns (address)

Create a new delegator

Parameters

Return Values

EigenDelegator

Delegator contract for stETH on Eigenlayer

STRATEGY_MANAGER

contract IStrategyManager STRATEGY_MANAGER

StrategyManager for Eigenlayer

DELEGATION_MANAGER

contract IDelegationManager DELEGATION_MANAGER

DelegationManager for Eigenlayer

STAKED_ETH_STRATEGY

contract IStrategy STAKED_ETH_STRATEGY

stETH strategy on Eigenlayer

withdrawals

mapping(bytes32 => uint256) withdrawals

initialize

function initialize(address _vault, address _operator) external

Initialize the contract

Parameters

currentOperator

address currentOperator

stETH

contract IStEth stETH

queuedShares

uint256 queuedShares

_delegate

function _delegate(uint256 amount) internal

Modifier to allow function calls only from the vault or harvester

Delegate & restake stETH to operator on Eigenlayer

Parameters

_requestWithdrawal

function _requestWithdrawal(uint256 assets) internal

Request withdrawal from eigenlayer

Parameters

completeWithdrawalRequest

function completeWithdrawalRequest(struct WithdrawalInfo[] withdrawalInfo) external

Complete withdrawal request

Parameters

recordWithdrawalsRequest

function recordWithdrawalsRequest(struct WithdrawalInfo withdrawal) external

Record withdrawal request from External requests

Parameters

withdraw

function withdraw() external

Withdraw stETH from delegator to vault

withdrawableAssets

function withdrawableAssets() public view returns (uint256)

Get withdrawable assets

Return Values

queuedAssets

function queuedAssets() public view returns (uint256)

Get queued assets

Return Values

_delegateToOperator

function _delegateToOperator() internal

Delegate to operator

IDelegator

requestWithdrawal

function requestWithdrawal(uint256 assets) external

checkAssetAvailability

function checkAssetAvailability(uint256 assets) external view returns (bool)

delegate

function delegate(uint256 amount) external

withdraw

function withdraw() external

totalLockedValue

function totalLockedValue() external returns (uint256)

withdrawableAssets

function withdrawableAssets() external view returns (uint256)

queuedAssets

function queuedAssets() external view returns (uint256)

SymDelegatorFactory

SymDelegator Factory contract

vault

address vault

onlyVault

modifier onlyVault()

Modifier to allow function calls only from the vault

constructor

constructor(address _vault) public

Constructor

Parameters

createDelegator

function createDelegator(address _collateral) external returns (address proxy)

Create a new delegator

Parameters

Return Values

SymbioticDelegator

Delegator contract for wStETH on Symbiotic

collateral

contract IDefaultCollateral collateral

initialize

function initialize(address _vault, address _collateral) external

Initialize the contract

Parameters

_delegate

function _delegate(uint256 amount) internal

Delegate & restake wStETH to operator on Symbiotic

Parameters

_requestWithdrawal

function _requestWithdrawal(uint256 assets) internal

Request withdrawal from Symbiotic

Parameters

withdrawableAssets

function withdrawableAssets() public view returns (uint256)

Get the withdrawable assets

Return Values

queuedAssets

function queuedAssets() public view returns (uint256)

Get the queued assets

Return Values

UltraLRT

UltraLRT is a liquid staking vault that allows users to deposit staked assets and receive shares in return. The shares can be redeemed for the underlying assets at any time. Vault will delegate the assets to the delegators and harvest the profit. The vault will also distribute the profits to the holders.

initialize

function initialize(address _governance, address _asset, address _delegatorBeacon, string _name, string _symbol) external

Initialize the UltraLRT contract

Parameters

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

Upgrade the UltraLRT contract

Parameters

maxDeposit

function maxDeposit(address) public view virtual returns (uint256)

The maximum amount of assets that can be deposited into the vault

See {IERC4262-maxDeposit}.

Return Values

maxMint

function maxMint(address) public view virtual returns (uint256)

The maximum amount of shares that can be minted

See {IERC4262-maxMint}.

Return Values

setDelegatorFactory

function setDelegatorFactory(address _factory) external

set the delegator factory

factory must have the vault set to this vault

Parameters

setMaxUnresolvedEpochs

function setMaxUnresolvedEpochs(uint256 _maxUnresolvedEpochs) external

set max unresolved epoch

delegation of assets will be stopped if the unresolved epoch is greater than the max unresolved epoch

Parameters

pause

function pause() external

Pause the contract

unpause

function unpause() external

Unpause the contract

initialSharesPerAsset

function initialSharesPerAsset() public pure virtual returns (uint256)

The amount of shares to mint per wei of asset at genesis.

_initialShareDecimals

function _initialShareDecimals() internal pure virtual returns (uint8)

Each wei of asset at genesis is worth 10 ** (initialShareDecimals) shares.

pauseDeposit

function pauseDeposit() external

Pause the deposit

unpauseDeposit

function unpauseDeposit() external

Unpause the deposit

deposit

function deposit(uint256 assets, address receiver) public returns (uint256)

Deposit assets into the vault

Parameters

Return Values

mint

function mint(uint256 shares, address receiver) public returns (uint256)

mint specific amount of shares

Parameters

Return Values

withdraw

function withdraw(uint256 assets, address receiver, address owner) public returns (uint256)

Withdraw assets from the vault

See {IERC4262-withdraw}.

Parameters

Return Values

redeem

function redeem(uint256 shares, address receiver, address owner) public returns (uint256)

Redeem shares from the vault

See {IERC4262-redeem}.

Parameters

Return Values

_withdraw

function _withdraw(address caller, address receiver, address owner, uint256 assets, uint256 shares) internal

withdraw from the vault

Parameters

canWithdraw

function canWithdraw(uint256 assets) public view returns (bool)

Check if the withdrawal can be done

Parameters

Return Values

setWithdrawalEscrow

function setWithdrawalEscrow(contract WithdrawalEscrowV2 _escrow) external

Set the withdrawal escrow

The escrow must have the vault set to this vault @dev existing escrow debt must be zero

Parameters

endEpoch

function endEpoch() external

End the current epoch

Only the harvester can end the epoch anytime for other The epoch can only be ended if the last epoch was ended at least LOCK_INTERVAL seconds ago

liquidationRequest

function liquidationRequest(uint256 assets) external

Do liquidation request to delegators

Only the harvester can do the liquidation request

Parameters

_liquidationRequest

function _liquidationRequest(uint256 assets) internal

Do liquidation request to delegators

Parameters

delegatorWithdrawRequest

function delegatorWithdrawRequest(contract IDelegator delegator, uint256 assets) external

Withdraw from speicific delegator

Parameters

resolveDebt

function resolveDebt() external

Resolve the debt

createDelegator

function createDelegator(address _operator) external

Create a new delegator

Parameters

dropDelegator

function dropDelegator(address _delegator) external

Drop a delegator

Parameters

harvest

function harvest() external

Harvest the profit

collectDelegatorDebt

function collectDelegatorDebt() external

Collect the delegator debt

will withdraw the liquid assets from the delegators

withdrawFromDelegator

function withdrawFromDelegator(address _delegator) external

TODO check for price change on profit and loss

_getDelegatorLiquidAssets

function _getDelegatorLiquidAssets(uint256 requiredVaultAssets) internal

Get the delegator liquid assets

Each time this will check the vault assets, if it meets required assets then it will stop

Parameters

delegateToDelegator

function delegateToDelegator(address _delegator, uint256 amount) external

Delegate the assets to the delegator

Parameters

lockedProfit

function lockedProfit() public view virtual returns (uint256)

Current locked profit amount.

Profit unlocks uniformly over LOCK_INTERVAL seconds after the last harvest

totalAssets

function totalAssets() public view returns (uint256)

Get the total assets

vaultAssets

function vaultAssets() public view returns (uint256)

Get the vault liquid assets

setManagementFee

function setManagementFee(uint256 feeBps) external

Set the management fee

setWithdrawalFee

function setWithdrawalFee(uint256 feeBps) external

Set the withdrawal fee

getRate

function getRate() external view returns (uint256)

returns the per share assets

UltraLRTRouter

handle deposits from native, weth, stEth, wStEth to vaults

weth

contract IWETH weth

stEth

contract IStEth stEth

wStEth

contract IWSTETH wStEth

permit2

contract IPermit2 permit2

initialize

function initialize(address _governance, address _weth, address _stEth, address _wStEth, address _permit2) external

Initialize the contract

Parameters

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

Upgrade the contract

Parameters

pause

function pause() external

Pause the contract

unpause

function unpause() external

Unpause the contract

receive

receive() external payable

Fallback function to receive native tokens

depositNative

function depositNative(address vault, address to) public payable

Deposit native tokens to vault

Parameters

_processNativeDeposit

function _processNativeDeposit(uint256 amount, address vault, address to) internal

Deposit native tokens to vault

Parameters

_receiveAssetFromThroughPermit2

function _receiveAssetFromThroughPermit2(address token, uint256 amount, uint256 nonce, uint256 deadline, bytes signature) internal

Receive asset from user through permit2

Parameters

depositWeth

function depositWeth(uint256 amount, address vault, address to, uint256 nonce, uint256 deadline, bytes signature) external

Deposit WETH to vault

Parameters

depositStEth

function depositStEth(uint256 amount, address vault, address to, uint256 nonce, uint256 deadline, bytes signature) external

Deposit stETH to vault

Parameters

depositWStEth

function depositWStEth(uint256 amount, address vault, address to, uint256 nonce, uint256 deadline, bytes signature) external

Deposit wStETH to vault

Parameters

_processDepositFromStEth

function _processDepositFromStEth(uint256 amount, address vault, address to) internal

Process deposit from stEth

Parameters

_depositStEthToVault

function _depositStEthToVault(uint256 amount, address vault, address to) internal

Deposit stEth to vault

Parameters

_depositWStEthToVault

function _depositWStEthToVault(uint256 amount, address vault, address to) internal

Deposit wStEth to vault

Parameters

UltraLRTStorage

DelegatorInfo

struct DelegatorInfo {
  bool isActive;
  uint248 balance;
}

GUARDIAN_ROLE

bytes32 GUARDIAN_ROLE

HARVESTER

bytes32 HARVESTER

MAX_BPS

uint256 MAX_BPS

MAX_DELEGATOR

uint256 MAX_DELEGATOR

ST_ETH_TRANSFER_BUFFER

uint256 ST_ETH_TRANSFER_BUFFER

depositPaused

uint256 depositPaused

STETH

contract IStEth STETH

escrow

contract WithdrawalEscrowV2 escrow

beacon

address beacon

delegatorFactory

address delegatorFactory

delegatorAssets

uint256 delegatorAssets

managementFee

uint256 managementFee

Fee charged to vault over a year, number is in bps

withdrawalFee

uint256 withdrawalFee

Fee charged on redemption of shares, number is in bps

lastHarvest

uint256 lastHarvest

A timestamp representing when the most recent harvest occurred.

Since the time since the last harvest is used to calculate management fees, this is set to block.timestamp (instead of 0) during initialization.

maxLockedProfit

uint256 maxLockedProfit

The amount of profit originally locked after harvesting from a strategy

LOCK_INTERVAL

uint256 LOCK_INTERVAL

Amount of time in seconds that profit takes to fully unlock. See lockedProfit().

delegatorQueue

contract IDelegator[50] delegatorQueue

delegatorMap

mapping(address => struct UltraLRTStorage.DelegatorInfo) delegatorMap

delegatorCount

uint256 delegatorCount

lastEpochTime

uint256 lastEpochTime

maxUnresolvedEpochs

uint256 maxUnresolvedEpochs

whenDepositNotPaused

modifier whenDepositNotPaused()

WithdrawalEscrowV2

Escrow contract for withdrawal requests

asset

contract ERC20 asset

The vault asset.

vault

contract UltraLRT vault

The vault this escrow attached to.

userDebtShare

mapping(uint256 => mapping(address => uint256)) userDebtShare

EpochInfo

struct EpochInfo {
  uint128 shares;
  uint128 assets;
}

currentEpoch

uint256 currentEpoch

resolvingEpoch

uint256 resolvingEpoch

totalDebt

uint256 totalDebt

epochInfo

mapping(uint256 => struct WithdrawalEscrowV2.EpochInfo) epochInfo

constructor

constructor(contract UltraLRT _vault) public

Parameters

onlyVault

modifier onlyVault()

Modifier to allow function calls only from the vault

onlyGovernance

modifier onlyGovernance()

Modifier to allow function calls only from the governance

WithdrawalRequest

event WithdrawalRequest(address user, uint256 epoch, uint256 shares)

Withdrawal Request event

will makes things easy to search for each user withdrawal requests

Parameters

registerWithdrawalRequest

function registerWithdrawalRequest(address user, uint256 shares) external

Register withdrawal request as debt

Parameters

endEpoch

function endEpoch() external

End the epoch

will be called by the vault after closing a position

getDebtToResolve

function getDebtToResolve() external view returns (uint256)

Get the debt to resolve

Return Values

resolveDebtShares

function resolveDebtShares() external

resolve the locked shares for current epoch

This function will be triggered after closing a position will check for available shares to burn after resolving vault will send the assets to escrow and burn the share

redeemMultiEpoch

function redeemMultiEpoch(address user, uint256[] epochs) public returns (uint256 totalAssets)

Redeem multiple epochs

Parameters

Return Values

redeem

function redeem(address user, uint256 epoch) public returns (uint256)

Redeem withdrawal request

Parameters

Return Values

_epochSharesToAssets

function _epochSharesToAssets(address user, uint256 epoch) internal view returns (uint256)

Convert epoch shares to assets

Parameters

Return Values

canWithdraw

function canWithdraw(uint256 epoch) public view returns (bool)

Check if an epoch is completed or not

Parameters

Return Values

withdrawableAssets

function withdrawableAssets(address user, uint256 epoch) public view returns (uint256)

Get withdrawable assets of a user

Parameters

Return Values

withdrawableShares

function withdrawableShares(address user, uint256 epoch) public view returns (uint256)

Get withdrawable shares of a user

Parameters

Return Values

getAssets

function getAssets(address user, uint256[] epochs) public view returns (uint256 assets)

Get total withdrawable assets of a user for multiple epochs

Parameters

Return Values

sweep

function sweep(address _asset) external

sweep the assets to governance

only use case in case of emergency

Parameters

Last updated