Smart Contracts

RockSolid vaults build upon the Lagoon ERC7540 Asynchronous Vault implementations. As such, these docs equally apply to RockSolid.

Quick Start Guide

You can see all the read and write functions on etherscan.

Deposit

function syncDeposit(uint256 assets, address receiver, address referral) payable returns (uint256 shares);    
Parameter
Value

assets

The amount of assets to deposit, in wei

receiver

The recipient, usually the connected wallet

referral

Referrer if you are running a referral program or 0x0000000000000000000000000000000000000000 if not or there is no referrer

Withdraw

Withdrawal is two step. 1) You request to redeem and approximately 24 hours after processing 2) redeem

function requestRedeem(uint256 shares, address receiver, address controller)
Parameter
Value

shares

The amount of shares to redeem, retrievable from vault.balanceOf(address)

receiver

The recipient of the shares. Should be depositor unless this is a custodian integration.

controller

Should be the depositor, unless this is a custodian integration.

function redeem(uint256 shares, address receiver, address controller)
Paramter
Value

shares

The amount of shares to redeem. Should be the same value supplied to requestRedeem()

receiver

The recipient of the shares. Should be the deposior unless this is a custodian integration.

controller

Should be the depositor, unless this is a custodian integration.

View Balance

The number of shares a user address owns is available via:

vault.balanceOf(userAddress) +
vault.pendingRedeemRequest(0, userAddress); → user shares waiting to be redeemed

Utility Functions

Standard ERC20 and ERC4626 functions that are helpful during integration include

convertToAssets(uint256 shares) → how much asset (e.g. rETH) per share
convertToShares(uint256 assets) → how many shares (e.g. rock.rETH) per asset
totalAssets() → total assets in the vault, aka TVL
totalSupply() → total shares in the vault.
symbol() → name of the share e.g. rock.rETH
name() → name of the vault e.g. RockSolid rETH Vault
safe() → address of the controlling wallet. May be a Safe or MPC.

Last updated