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
  1. Devs
  2. Smart Contract Architecture

Whitelist

PreviousVaultNextYieldOracle constants

Inherits: Ownable2Step

An external Whitelist module that Ion's system-wide contracts can use to verify that a user is permitted to borrow or lend. A merkle whitelist is used to allow for a large number of addresses to be whitelisted without consuming infordinate amounts of gas for the updates. There is also a protocol whitelist that can be used to allow for a protocol controlled address to bypass the merkle proof check. These protocol-controlled contract are expected to perform whitelist checks themsleves on their own entrypoints.

The full merkle tree is stored off-chain and only the root is stored on-chain.

State Variables

protocolWhitelist

mapping(address protocolControlledAddress => bool) public protocolWhitelist;

borrowersRoot

mapping(uint8 ilkIndex => bytes32) public borrowersRoot;

lendersRoot

bytes32 public lendersRoot;

Functions

constructor

Creates a new Whitelist instance.

constructor(bytes32[] memory _borrowersRoots, bytes32 _lendersRoot) Ownable(msg.sender);

Parameters

Name
Type
Description

_borrowersRoots

bytes32[]

List borrower merkle roots for each ilk.

_lendersRoot

bytes32

The lender merkle root.

updateBorrowersRoot

Updates the borrower merkle root for a specific ilk.

function updateBorrowersRoot(uint8 ilkIndex, bytes32 _borrowersRoot) external onlyOwner;

Parameters

Name
Type
Description

ilkIndex

uint8

of the ilk.

_borrowersRoot

bytes32

The new borrower merkle root.

updateLendersRoot

Updates the lender merkle root.

function updateLendersRoot(bytes32 _lendersRoot) external onlyOwner;

Parameters

Name
Type
Description

_lendersRoot

bytes32

The new lender merkle root.

approveProtocolWhitelist

Approves a protocol controlled address to bypass the merkle proof check.

function approveProtocolWhitelist(address addr) external onlyOwner;

Parameters

Name
Type
Description

addr

address

The address to approve.

revokeProtocolWhitelist

Revokes a protocol controlled address to bypass the merkle proof check.

function revokeProtocolWhitelist(address addr) external onlyOwner;

Parameters

Name
Type
Description

addr

address

The address to revoke approval for.

isWhitelistedBorrower

Called by external modifiers to prove inclusion as a borrower.

If the root is just zero, then the whitelist is effectively turned off as every address will be allowed.

function isWhitelistedBorrower(
    uint8 ilkIndex,
    address poolCaller,
    address addr,
    bytes32[] calldata proof
)
    external
    view
    returns (bool);

Returns

Name
Type
Description

<none>

bool

True if the addr is part of the borrower whitelist or the protocol whitelist. False otherwise.

isWhitelistedLender

Called by external modifiers to prove inclusion as a lender.

If the root is just zero, then the whitelist is effectively turned off as every address will be allowed.

function isWhitelistedLender(address poolCaller, address addr, bytes32[] calldata proof) external view returns (bool);

Returns

Name
Type
Description

<none>

bool

True if the addr is part of the lender whitelist or the protocol whitelist. False otherwise.

Errors

NotWhitelistedBorrower

error NotWhitelistedBorrower(uint8 ilkIndex, address addr);

NotWhitelistedLender

error NotWhitelistedLender(address addr);

๐Ÿ’ป
Git Source