IonLens

Git Source

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

NameTypeDescription

<none>

uint256

The total amount of collateral in the pool.

getIlkIndex

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

Returns

NameTypeDescription

<none>

uint8

The index of the collateral with ilkAddress.

totalNormalizedDebt

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

Returns

NameTypeDescription

<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

NameTypeDescription

<none>

uint256

The rate that has been persisted to storage.

lastRateUpdate

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

Returns

NameTypeDescription

<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

NameTypeDescription

<none>

address

The spot oracle for collateral with index ilkIndex.

debtCeiling

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

Returns

NameTypeDescription

<none>

uint256

The debt ceiling for collateral with index ilkIndex.

dust

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

Returns

NameTypeDescription

<none>

uint256

The dust value for collateral with index ilkIndex.

gem

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

Returns

NameTypeDescription

<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

NameTypeDescription

<none>

uint256

The amount of unbacked debt user has.

isOperator

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

Returns

NameTypeDescription

<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

NameTypeDescription

<none>

uint256

The total amount of debt.

liquidity

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

Returns

NameTypeDescription

<none>

uint256

The total amount of ETH liquidity in the pool.

supplyCap

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

Returns

NameTypeDescription

<none>

uint256

The supply cap

totalUnbackedDebt

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

Returns

NameTypeDescription

<none>

uint256

The total amount of unbacked debt.

interestRateModule

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

Returns

NameTypeDescription

<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;
}