For the complete documentation index, see llms.txt. This page is also available as Markdown.

Architecture

Technical architecture reference for the Elara protocol.

System Overview

Elara is a KYC-gated, compliant token issuance protocol. Users deposit supported collateral tokens to receive elUSD, stake elUSD to earn yield through sElUSD shares, and redeem collateral at any time. The protocol is composed of nine independently upgradeable contracts governed by a shared AccessManager.

Contract Map

Contract
Role

Vault

Core: minting, redeeming, yield routing

ElUSD

Protocol-issued token (18 dec) — mintable/burnable by Vault

sElUSD

ERC20 share token representing staked elUSD

ElUSDStake

Share-based staking pool; issues and redeems sElUSD

TreasuryAdapter

Coordinates fund routing without holding funds

PriceOracle

Pluggable price-feed wrapper (18-decimal normalized); depeg guard for stablecoin collateral

KYCRegistry

On-chain KYC status per address

TokenRegistry

Supported collateral configs and per-token fee rates

ElaraBase

Abstract base: UUPS + access control + pause + reentrancy

Inheritance

Every protocol contract inherits ElaraBase, which composes four OpenZeppelin upgradeable bases:

ElaraBase
├── AccessManagedUpgradeable   — role-based function restrictions
├── UUPSUpgradeable            — proxy-safe upgrade pattern
├── ReentrancyGuardUpgradeable — reentrancy protection
└── PausableUpgradeable        — emergency pause

Cross-Contract Dependencies

Treasury Architecture

TreasuryAdapter is a coordination layer only — it holds no funds itself:

  • depositWallet — receives collateral tokens from mint operations

  • withdrawWallet — provides collateral for redemptions; must pre-approve the Vault

This separation allows the treasury to deploy deposited collateral to yield strategies independently of maintaining redemption liquidity in the withdrawal pool.

Access Control Roles

Roles are managed by OpenZeppelin AccessManager and enforced via the restricted modifier.

Role
Capabilities

CONTRACT_ADMIN

Configure fees, oracle settings, contract addresses

KYC_OPERATOR

Grant / revoke KYC status in bulk

PAUSE_OPERATOR

Pause / unpause any contract

UPGRADE_OPERATOR

Authorize UUPS upgrades

MINT_OPERATOR

Mint elUSD and sElUSD (granted to Vault)

BURN_OPERATOR

Burn elUSD and sElUSD (granted to Vault)

PUBLIC_ROLE

settleRedemption — callable by anyone

Storage Layout

All contracts reserve a 50-slot __gap for future upgrades (EIP-1967).

Contract
Key State

Vault

queuedRedemptions mapping(uint256 → Redemption), redemptionIdCounter

ElUSD

isBlocked mapping(address → bool)

ElUSDStake

_elUSD, _sElUSD, _vault

KYCRegistry

isKycApproved mapping(address → bool)

TokenRegistry

tokenConfigs mapping(address → TokenConfig), supportedTokens address[]

PriceOracle

oracleTypes mapping(address → OracleType), chainlinkConfigs mapping(address → ChainlinkConfig)

TreasuryAdapter

depositWallet, withdrawWallet, vault

Last updated

Was this helpful?