Ion Protocol
HomeDiscordTwitter
  • Overview
    • ๐Ÿ’งWelcome to Ion Protocol
    • ๐Ÿ“šUnderstanding the Staking and Restaking Ecosystem
    • ๐Ÿ”—Official Links
    • โ”FAQ
  • Ion Protocol
    • โš™๏ธHow Ion Works
    • ๐Ÿ‘ฅReferrals
    • ๐Ÿ’ฆIon Points
  • Lending
    • ๐Ÿ’ฐHow To Lend On Ion
    • ๐ŸŒETH-on-ETH Yield
    • ๐ŸงชLending Mechanisms
      • Composable Markets
      • ZKML-Supported Risk Underwriting
  • Borrowing
    • ๐Ÿ’ธHow To Borrow On Ion
    • ๐Ÿ“ˆMultiplying Rewards
    • ๐Ÿ› ๏ธBorrowing Mechanisms
      • Flash Leverage
      • Interest Rates
      • ZK Proof-of-Reserve
  • Liquidations
    • ๐Ÿ“‰Liquidation Mechanism
    • ๐Ÿง‘โ€๐Ÿ’ปKeepers
  • Supported Collateral
    • LSTs
    • LRTs
    • Exotic ETH-Backed Assets
  • Devs
    • ๐Ÿ’ปSmart Contract Architecture
      • Home
      • Admin
        • ProxyAdmin
        • TransparentUpgradeableProxy
        • ITransparentUpgradeableProxy
      • Flash
        • LRT
          • RsEthHandler
          • EzEthHandler
          • RswEthHandler
          • WeEthHandler
        • LST
          • SwEthHandler
          • EthXHandler
          • WstEthHandler
        • BalancerFlashloanDirectMintHandler constants
        • BalancerFlashloanDirectMintHandler
        • PtHandler
        • IonHandlerBase
        • UniswapFlashloanBalancerSwapHandler
        • UniswapFlashswapDirectMintHandler
        • UniswapFlashswapDirectMintHandlerWithDust
        • UniswapFlashswapHandler
      • Join
        • GemJoin
      • Libraries
        • LRT
          • KelpDaoLibrary
          • EtherFiLibrary
          • RestakedSwellLibrary
          • RenzoLibrary
        • LST
          • StaderLibrary
          • LidoLibrary
          • SwellLibrary
        • math
          • WadRayMath constants
          • WadRayMath
        • uniswap
          • UniswapOracleLibrary
          • TickMath
      • Oracles
        • Reserve
          • LRT
            • EzEthWstEthReserveOracle
            • RsEthWstEthReserveOracle
            • RswEthWstEthReserveOracle
            • WeEthWstEthReserveOracle
          • LST
            • SwEthReserveOracle
            • EthXReserveOracle
            • WstEthReserveOracle
          • Pendle
            • EzEthPtReserveOracle
            • RsEthPtReserveOracle
            • RswEthPtReserveOracle
            • WeEthPtReserveOracle
          • ReserveOracle
          • ReserveFeed
          • ReserveOracle constants
        • Spot
          • LRT
            • EzEthWstEthSpotOracle
            • RsEthWstEthSpotOracle
            • RswEthWstEthSpotOracle
            • WeEthWstEthSpotOracle
          • LST
            • EthXSpotOracle constants
            • EthXSpotOracle
            • IRedstonePriceFeed
            • SwEthSpotOracle
            • WstEthSpotOracle
          • SpotOracle
          • PtSpotOracle
      • Periphery
        • IonInvariants
        • IonLens
        • IlkSlot0
        • IonRegistry
      • Token
        • IERC20Errors
        • RewardToken
      • Vault
        • VaultFactory
        • Vault
      • Whitelist
      • YieldOracle constants
      • YieldOracle
      • YieldOracleNull
      • YieldOraclePendle
      • Errors
      • Constants
      • Seaport Leverage and Deleverage
    • ๐Ÿ“„Deployed Contracts
  • Security
    • ๐Ÿ”Security Reviews
  • Legal
    • Terms of Use
    • Privacy Policy
  • Import
    • ProxyAdmin
Powered by GitBook
On this page
  • State Variables
  • Functions
  • Errors
  • Structs
  1. Devs
  2. Smart Contract Architecture
  3. Periphery

IonLens

PreviousIonInvariantsNextIlkSlot0

Inherits: IIonLens

State Variables

IonPoolStorageLocation

bytes32 private constant IonPoolStorageLocation = 0xceba3d526b4d5afd91d1b752bf1fd37917c20a6daf576bcb41dd1c57c1f67e00;

EXTSLOAD_SELECTOR

bytes4 private constant EXTSLOAD_SELECTOR = 0x1e2eaeaf;

Functions

constructor

constructor();

_getIonPoolStorage

function _getIonPoolStorage() internal pure returns (IonPoolStorage storage $);

_toUint256PointerMapping

function _toUint256PointerMapping(mapping(bytes32 => uint256) storage inPtr)
    private
    pure
    returns (mapping(address => StorageSlot.Uint256Slot) storage outPtr);

queryPoolSlot

function queryPoolSlot(IIonPool pool, uint256 slot) public view returns (uint256 value);

ilkCount

function ilkCount(IIonPool pool) external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The total amount of collateral in the pool.

getIlkIndex

function getIlkIndex(IIonPool pool, address ilkAddress) external view returns (uint8);

Returns

Name
Type
Description

<none>

uint8

The index of the collateral with ilkAddress.

totalNormalizedDebt

function totalNormalizedDebt(IIonPool pool, uint8 ilkIndex) external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The total amount of normalized debt for collateral with index ilkIndex.

rateUnaccrued

function rateUnaccrued(IIonPool pool, uint8 ilkIndex) external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The rate that has been persisted to storage.

lastRateUpdate

function lastRateUpdate(IIonPool pool, uint8 ilkIndex) external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The timestamp of the last rate update for collateral with index ilkIndex.

spot

function spot(IIonPool pool, uint8 ilkIndex) external view returns (address);

Returns

Name
Type
Description

<none>

address

The spot oracle for collateral with index ilkIndex.

debtCeiling

function debtCeiling(IIonPool pool, uint8 ilkIndex) external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The debt ceiling for collateral with index ilkIndex.

dust

function dust(IIonPool pool, uint8 ilkIndex) external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The dust value for collateral with index ilkIndex.

gem

function gem(IIonPool pool, uint8 ilkIndex, address user) external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

Amount of gem that user has for collateral with index ilkIndex.

unbackedDebt

function unbackedDebt(IIonPool pool, address unbackedDebtor) external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The amount of unbacked debt user has.

isOperator

function isOperator(IIonPool pool, address user, address operator) external view returns (bool);

Returns

Name
Type
Description

<none>

bool

Whether or not operator is an operator on user's positions.

debtUnaccrued

function debtUnaccrued(IIonPool pool) public view returns (uint256);

debt

This includes unbacked debt.

function debt(IIonPool pool) external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The total amount of debt.

liquidity

function liquidity(IIonPool pool) external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The total amount of ETH liquidity in the pool.

supplyCap

function supplyCap(IIonPool pool) external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The supply cap

totalUnbackedDebt

function totalUnbackedDebt(IIonPool pool) external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The total amount of unbacked debt.

interestRateModule

function interestRateModule(IIonPool pool) external view returns (address);

Returns

Name
Type
Description

<none>

address

The address of the interest rate module.

whitelist

function whitelist(IIonPool pool) external view returns (address);

Errors

SloadFailed

error SloadFailed();

InvalidFieldSlot

error InvalidFieldSlot();

Structs

Ilk

struct Ilk {
    IlkSlot0 slot0;
    StorageSlot.AddressSlot spot;
    StorageSlot.Uint256Slot debtCeiling;
    StorageSlot.Uint256Slot dust;
}

Vault

struct Vault {
    StorageSlot.Uint256Slot collateral;
    StorageSlot.Uint256Slot normalizedDebt;
}

IonPoolStorage

struct IonPoolStorage {
    Ilk[] ilks;
    EnumerableSet.AddressSet ilkAddresses;
    mapping(uint256 ilkIndex => mapping(address user => Vault)) vaults;
    mapping(uint256 ilkIndex => mapping(address user => StorageSlot.Uint256Slot)) gem;
    mapping(address unbackedDebtor => StorageSlot.Uint256Slot) unbackedDebt;
    mapping(address user => mapping(address operator => StorageSlot.Uint256Slot)) isOperator;
    StorageSlot.Uint256Slot debt;
    StorageSlot.Uint256Slot liquidity;
    StorageSlot.Uint256Slot supplyCap;
    StorageSlot.Uint256Slot totalUnbackedDebt;
    StorageSlot.AddressSlot interestRateModule;
    StorageSlot.AddressSlot whitelist;
}

๐Ÿ’ป
Git Source