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

ElUSD

Git Source

Inherits: ElaraBase, IElUSD, ERC20PermitUpgradeable

Title: Elara USD Token Contract

ERC20 stablecoin with permit, pause, and ban functionality for the Elara protocol

Implements a stablecoin with administrative controls for blocking accounts and pausing functionality Invariants:

  • Only authorized accounts can mint or burn tokens

  • Blocked accounts cannot transfer tokens

  • Token transfers are paused when contract is paused Upgradeability:

  • Uses ElaraBase for UUPS upgradeability

  • Initializer must be called exactly once; preserve storage layout

Note: security-contact: [email protected]

State Variables

isBlocked

Public mapping; getter returns whether account is blocked. Only modifiable through restricted functions.

mapping(address => bool) public isBlocked

__gap

Reserved storage gap for future upgrades to prevent storage collisions

Functions

initialize

Initializes the ElUSD token contract with core parameters

Security:

  • Only callable during initialization via {initializer} modifier

  • Sets up ERC20 token with name and symbol via {__ERC20_init}

  • Enables permit functionality via {__ERC20Permit_init}

  • Establishes access control via {__ElaraBase_init}

  • Critical for token initialization; must be called exactly once per proxy

Parameters

Name
Type
Description

_accessManager

address

Address of the AccessManager contract

_name

string

The name of the token

_symbol

string

The symbol of the token

mint

Reverts if to is zero address. Emits {Minted} event on success.

burn

Reverts if from is zero address. Emits {Burned} event on success.

blockAddresses

Iterates through addresses array and blocks each account. Emits AccountBlockStatusChanged per address.

unblockAddresses

Iterates through addresses array and unblocks each account. Emits AccountBlockStatusChanged per address.

_update

Hook called before any token transfer to enforce blocks and pause

Security:

  • Protected by {whenNotPaused} modifier to prevent transfers when paused

  • Checks if sender is blocked and reverts via {AccountBlocked}

  • Skips block check for minting operations (from == address(0))

  • Skips block check for burning operations (to == address(0)); authorized callers can burn tokens from blocked accounts (intentional compliance mechanism)

  • Overrides ERC20Upgradeable-_update to add custom transfer restrictions

Parameters

Name
Type
Description

from

address

Source address (address(0) for minting)

to

address

Destination address (address(0) for burning)

value

uint256

Amount to transfer (18 decimals)

_blockAccount

Internal function to block an account from transfers

Security:

  • Reverts if account is already blocked via {AccountBlocked}

  • Updates block status in {isBlocked} mapping

  • Emits AccountBlockStatusChanged with block status and admin address

Parameters

Name
Type
Description

account

address

The address to block

_unblockAccount

Internal function to unblock an account for transfers

Security:

  • Reverts if account is not currently blocked via {AccountNotBlocked}

  • Updates block status in {isBlocked} mapping

  • Emits AccountBlockStatusChanged with unblock status and admin address

Parameters

Name
Type
Description

account

address

The address to unblock

Events

AccountBlockStatusChanged

Emitted when an account's block status changes.

Parameters

Name
Type
Description

account

address

Account whose status changed; indexed.

isBlocked

bool

New status (true = blocked).

admin

address

Admin who performed the change; indexed.

Last updated

Was this helpful?