Smart Contract Reference

Source and Deployment Verification

This reference describes user-facing LUKSO flows in pool-contracts revision 55073ca. It is not an exhaustive ABI or proof that repository main matches a deployed implementation. Before integrating, compare the verified deployed proxy and implementation, ABI, linked vault, owners/operators, fees, restrictions and pause state with this source. Ethereum uses StakeWise contracts, not these contracts.

Amounts are integer base units (wei for LYX). Read state at a consistent block, account for rounding and simulate writes against the intended deployment. Do not infer native liquidity from a staked or token balance.

SLYXToken

Contract address: 0x8A3982f0A7d154D11a5f43EEc7F50E52eBBc8F7D

The SLYXToken contract is an LSP7 token. See the LSP7 interface docs on docs.lukso.tech for a technical documentation of all the inherited functions.

Stakingverse Staked LYX (sLYX) Token contract.

sLYX tokens represent liquid stake in the Stakingverse vault linked to this contract.

  • New sLYX tokens are minted by transferring LYX staked in the linked vault to this contract.
  • sLYX tokens can be burnt to convert them back to staked LYX.

The token owner can pause minting and burning. The implementation uses upgradeable libraries; verify upgrade authority through the deployed proxy and its configuration rather than assuming an upgrade permission from the library alone.

SLYX Read Functions

getExchangeRate

Get the amount of staked LYX represented by one sLYX, in wei. This accounting rate is not a market price or a promise of immediate withdrawal.

function getExchangeRate() external view returns (uint256);

Returns

NameTypeDescription
uint256The amount of LYX backing 1 sLYX (in wei).

getNativeTokenValue

Calculate how many staked LYX (including accumulated rewards) in the vault can be obtained in exchange for sLYXAmount.

Determine the value of sLYX in terms of the native token balance (LYX) staked in the vault. This function calculates the amount of LYX backing an amount of sLYX.

Formula: (sLYX amount * total stake held by sLYX contract in Vault) / total sLYX minted.

function getNativeTokenValue(uint256 sLyxAmount) public view returns (uint256);

Parameters

NameTypeDescription
sLyxAmountuint256The amount of sLYX to convert to staked LYX.

Returns

NameTypeDescription
uint256The amount of staked LYX backing a specific sLYX amount (in wei).

getSLYXTokenValue

Calculate how many sLYX tokens can be obtained when converting stakedLyxAmount.

Calculate the amount of sLYX backing an amount of LYX.

Formula: (LYX amount * total sLYX minted) / total stake held by sLYX contract in Vault.

function getSLYXTokenValue(uint256 stakedLyxAmount) public view returns (uint256);

Parameters

NameTypeDescription
stakedLyxAmountuint256The amount of staked LYX to calculate if exchanging to mint sLYX tokens.

Returns

NameTypeDescription
uint256The amount of sLYX backing a specific amount of staked LYX (in wei).

stakingVault

Address of the Vault contract linked to this SLYX Token contract. sLYX tokens represent liquid stake in this linked vault.

IVault public stakingVault;

SLYX Write Functions

burn

Note: burning is disabled when the token is paused, and also depends on the linked vault accepting the returned stake.

Convert amount of sLYX tokens back to staked LYX (including any accumulated rewards).

The returned value is staked LYX credited to from in the vault, not native LYX sent to a wallet. The caller must be the holder or an authorized LSP7 operator. To receive native LYX, the stake holder must separately call the vault's withdraw, then claim any funded pending amount. A restricted vault can prevent a non-allowlisted recipient from receiving the returned stake.

function burn(
    address from,
    uint256 amount,
    bytes memory data
) public virtual override whenNotPaused;

Parameters

NameTypeDescription
fromaddressThe address to burn sLYX from its balance.
amountuint256The amount of sLYX to convert to staked LYX.
databytesAny optional data to send when notifying the from address via its universalReceiver(...) function that some sLYX tokens were burnt from its balance and converted back to staked LYX.

onVaultStakeReceived

Note: minting sLYX tokens via this function is disabled when the contract is paused by the admin.

Mint new sLYX tokens by transferring LYX staked in the Vault to this SLYXToken contract.

This hook is called when:

  • calling the transferStake(address,uint256,bytes) function,
  • or calling the deposit(address) function, on the linked staking vault, passing the SLYXToken contract address as parameter for address. Only the linked vault can call this function. New sLYX minted can be monitored by listening for the Transfer event on the SLYXToken contract and filtering with address(0) as from.
function onVaultStakeReceived(
    address from,
    uint256 amount,
    bytes calldata data
) external whenNotPaused;

Parameters

NameTypeDescription
fromaddressThe address to mint sLYX for.
amountuint256The amount of staked LYX to be converted into sLYX (at the LYX / sLYX exchange rate).
databytesAny optional data to send when notifying the from address via its universalReceiver(...) function that some sLYX tokens were minted for its address.

SLYX Errors

InvalidRecipientForSLYXTokensTransfer

Reverts when trying to transfer sLYX to one of these invalid recipient address:

  • the sLYX token contract
  • the vault proxy contract
error InvalidRecipientForSLYXTokensTransfer(address recipient);

Parameters

NameTypeDescription
recipientaddressThe rejected recipient address.

OnlyVaultAllowedToMintSLYX

Reverts when an address other than the vault is trying to mint sLYX

error OnlyVaultAllowedToMintSLYX(address caller);

Parameters

NameTypeDescription
calleraddressThe address trying to mint sLYX tokens.

StakingverseVault

Contract address: 0x9F49a95b0c3c9e2A6c77a16C177928294c0F6F04

Designed to manage staking operations, including depositing, withdrawing, and claiming rewards for stakers. Stakers can also query their staked balance, shares, claimable balance (including rewards) and pending withdrawals.

This contract includes admin functionalities (vault owner and operator) for fee management, adding new operators and registering validators in the deposit contract. It also includes a rebalancing mechanism done periodically by an oracle.

The contract implements reentrancy protection, pausable functionality and an upgradeable pattern using OpenZeppelin's upgradeable libraries, which are safeguards and design mechanisms, not guarantees of safety. Verify actual proxy upgrade permissions on the deployed contracts.

Vault Read Functions

balanceOf

Get the current accounted staked LYX represented by account's vault shares, including the effect of vault accounting. This excludes that account's pending withdrawals and does not directly include sLYX held in its wallet.

function balanceOf(address account) public view override returns (uint256);

Parameters

NameTypeDescription
accountaddressThe address to query the staked balance for.

Returns

NameTypeDescription
uint256The amount of LYX staked by (or for) account.

sharesOf

Get the number of shares held by account which correspond to the proportion of its stake inside the vault.

function sharesOf(address account) external view override returns (uint256);

Parameters

NameTypeDescription
accountaddressThe address to get the shares for.

Returns

NameTypeDescription
uint256The number of shares held by account.

totalClaimable

Total amount of pending withdrawals that can be claimed immediately. Updated when the vault oracle rebalances the vault and when a user withdraw staked LYX via the claim(...) function.

uint256 public totalClaimable;

pendingBalanceOf

function pendingBalanceOf(address account) external view returns (uint256);

Returns the pending withdrawal balance recorded for account, in wei. The delayed portion of withdraw is assigned to its beneficiary, which may differ from the withdrawing stake holder. Pending does not mean funded or immediately claimable.

claimableBalanceOf

function claimableBalanceOf(address account) external view returns (uint256);

Returns the lesser of that account's pending balance and the vault's shared totalClaimable funds. This is a current-state quote, not a reservation: other claims or state changes can affect execution.

totalAssets and totalShares

totalAssets() returns the vault's accounted assets after pending-withdrawal liabilities; totalShares() is the share denominator used in vault accounting. Neither is a wallet's available native balance. Use balanceOf, sharesOf, pending and claimable reads for the appropriate stage of a position.

Vault Write Functions

deposit

Stake a certain amount of LYX in the Stakingverse's vault for beneficiary.

To stake LYX in the vault for beneficiary, send the amount of LYX native tokens while calling this function.

function deposit(address beneficiary) public payable override whenNotPaused;

Parameters

NameTypeDescription
beneficiaryaddressThe address to stake LYX for in the vault.

withdraw

Reduce the caller's vault stake by amount. Pay up to the vault's available totalUnstaked LYX immediately to beneficiary; record the unpaid remainder as a pending withdrawal for that beneficiary. One transaction may both pay LYX and create a pending amount.

The beneficiary must be nonzero and able to receive any immediate native payment. The caller needs enough direct vault stake; holding sLYX is not sufficient until it has been burned back to stake. Shares are removed when the withdrawal is requested, so the pending portion no longer participates as those vault shares. There is no fixed completion time for funding the remainder.

The amount to withdraw will reduce the staked balance (and therefore reduce its shares) of the address that called this function (caller / msg.sender).

function withdraw(uint256 amount, address beneficiary) external override nonReentrant whenNotPaused;

Parameters

NameTypeDescription
amountuint256The amount of staked LYX to withdraw.
beneficiaryaddressThe address to send the withdrawn amount to.

claim

Claim already-requested and funded native LYX from the caller's pending balance. This is a separate transaction from withdraw.

function claim(uint256 amount, address beneficiary) external override nonReentrant whenNotPaused;
  • amount: positive amount in wei, no greater than the caller's pending balance or the vault's totalClaimable.
  • beneficiary: nonzero destination for the native LYX payment, which must be able to receive it.

The account holding the pending withdrawal calls this function. It may choose a different payment recipient. A successful claim reduces that account's pending balance and the vault's pending and claimable totals. A partial claim leaves the remainder pending. A failed native transfer reverts the transaction.

transferStake

Transfer amount of staked LYX from the caller to the to address with optional data.

This function is used to transfer staked LYX from one address to another. It increases the staked balance of the recipient, and decreases the staked balance of the sender. If the to is a smart contract that support the IVaultStakeRecipient interface, the onVaultStakeReceived(...) function will be called on the recipient (with the three parameters account, amount and data) to notify it that some staked LYX tokens were transferred to its address.

function transferStake(address to, uint256 amount, bytes calldata data) external override whenNotPaused nonReentrant;

Parameters

NameTypeDescription
toaddressThe address to transfer the staked LYX to.
amountuint256The amount of staked LYX to transfer.
databytesOptional data.

Integration Lifecycle

  1. Deposit LYX for the intended beneficiary and verify Deposited plus its resulting balance.
  2. Optionally call the vault's transferStake to the linked token and verify minted sLYX.
  3. Burn sLYX when converting back to direct vault stake; check the returned stake, not only the token event.
  4. Call withdraw from the stake-owning account. Reconcile Withdrawn and WithdrawalRequested; a transaction may emit both.
  5. Read the pending beneficiary's balances. Once funded, that account calls claim and verifies Claimed plus the remaining pending amount.

The repository's withdrawal tests exercise deposit, conversion, token transfer, burn and withdrawal by the new holder. They also show that a token holder cannot withdraw backing as direct vault stake before burning.

Review security and administrative assumptions and the deployed ABI for additional management functions, errors and events. On a newly deployed vault, follow the token source's initial-deposit requirement before minting through a deposit to the token contract.