> For the complete documentation index, see [llms.txt](https://docs.elara.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.elara.fi/protocol-reference/reference/api-reference/token/contract.elusd.md).

# ElUSD

[Git Source](https://github.com/TrueFi-Protocol/elara-contracts-v2/blob/9301de6eec32ceafb4021f4e7da883b507799ebc/contracts/token/ElUSD.sol)

**Inherits:** [ElaraBase](https://github.com/TrueFi-Protocol/elara-contracts-v2/blob/docs/latest/contracts/base/ElaraBase.sol/abstract.ElaraBase.md), 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: <security@elara.finance>

## State Variables

### isBlocked

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

```solidity
mapping(address => bool) public isBlocked
```

### \_\_gap

Reserved storage gap for future upgrades to prevent storage collisions

```solidity
uint256[50] private __gap
```

## 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

```solidity
function initialize(address _accessManager, string memory _name, string memory _symbol) external initializer;
```

**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.

```solidity
function mint(address to, uint256 amount) external override(IElUSD) restricted;
```

### burn

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

```solidity
function burn(address from, uint256 amount) external override(IElUSD) restricted;
```

### blockAddresses

Iterates through addresses array and blocks each account. Emits [AccountBlockStatusChanged](https://github.com/TrueFi-Protocol/elara-contracts-v2/blob/docs/latest/contracts/token/ElUSD.sol/contract.ElUSD.md#accountblockstatuschanged) per address.

```solidity
function blockAddresses(address[] calldata addresses) external override(IElUSD) restricted;
```

### unblockAddresses

Iterates through addresses array and unblocks each account. Emits [AccountBlockStatusChanged](https://github.com/TrueFi-Protocol/elara-contracts-v2/blob/docs/latest/contracts/token/ElUSD.sol/contract.ElUSD.md#accountblockstatuschanged) per address.

```solidity
function unblockAddresses(address[] calldata addresses) external override(IElUSD) restricted;
```

### \_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](https://github.com/TrueFi-Protocol/elara-contracts-v2/blob/docs/latest/contracts/token/sElUSD.sol/contract.sElUSD.md#_update) to add custom transfer restrictions

```solidity
function _update(address from, address to, uint256 value) internal override whenNotPaused;
```

**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](https://github.com/TrueFi-Protocol/elara-contracts-v2/blob/docs/latest/contracts/token/ElUSD.sol/contract.ElUSD.md#accountblockstatuschanged) with block status and admin address

```solidity
function _blockAccount(address account) private;
```

**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](https://github.com/TrueFi-Protocol/elara-contracts-v2/blob/docs/latest/contracts/token/ElUSD.sol/contract.ElUSD.md#accountblockstatuschanged) with unblock status and admin address

```solidity
function _unblockAccount(address account) private;
```

**Parameters**

| Name      | Type      | Description            |
| --------- | --------- | ---------------------- |
| `account` | `address` | The address to unblock |

## Events

### AccountBlockStatusChanged

Emitted when an account's block status changes.

```solidity
event AccountBlockStatusChanged(address indexed account, bool isBlocked, address indexed admin);
```

**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. |
