LeRAAC Token¶
Overview¶
LeRAAC (implemented as LiquidEscrowedRAAC in LeRAAC.sol) is an ERC20 token used as a liquid, escrowed representation of RAAC within the protocol. It supports controlled minting with per-minter ceilings, and burning (including burnFrom) to pay down debt/maturity positions.
Purpose¶
- Serve as the borrowable/maturity token (
leRAAC) within the RAAC protocol - Allow multiple minters with individual mint ceilings
- Support burning by holders and
burnFromwith allowance checks
Functions¶
Minting¶
mint¶
mint(address _recipient, uint256 _amount)
Summary
Mints leRAAC to a recipient, respecting the caller's mint ceiling.
Access
External — Minter only
Parameters
| Name | Type | Description |
|---|---|---|
| _recipient | address | The address to receive the minted tokens |
| _amount | uint256 | The amount of leRAAC to mint |
Reverts
OnlyMinter()— if caller is not an authorized minterMintCeilingExceeded()— ifminted + amount > ceiling
Burning¶
burn¶
burn(uint256 _amount)
Summary
Burns the caller's leRAAC tokens.
Access
External
Parameters
| Name | Type | Description |
|---|---|---|
| _amount | uint256 | The amount of leRAAC to burn |
burnFrom¶
burnFrom(address _account, uint256 _amount)
Summary
Burns leRAAC from an account using allowance.
Access
External
Parameters
| Name | Type | Description |
|---|---|---|
| _account | address | The account to burn tokens from |
| _amount | uint256 | The amount of leRAAC to burn |
Reverts
BurnAmountExceedsAllowance()— if amount exceeds the caller's allowance
Minter Management¶
updateMinters¶
updateMinters(address[] calldata _minters, bool _status)
Summary
Enables or disables a set of minters.
Access
External — Owner only
Parameters
| Name | Type | Description |
|---|---|---|
| _minters | address[] | Array of minter addresses to update |
| _status | bool | true to enable, false to disable |
Emits
UpdateMinter(address _minter, bool _status)— for each minter updated
Reverts
ZeroMinterAddress()— if any address in the array is the zero address
updateCeiling¶
updateCeiling(address _minter, uint128 _ceiling)
Summary
Sets the mint ceiling for a minter.
Access
External — Owner only
Parameters
| Name | Type | Description |
|---|---|---|
| _minter | address | The minter address to update |
| _ceiling | uint128 | The maximum amount the minter can mint |
Emits
UpdateCeiling(address _minter, uint128 _ceiling)
Reverts
NotMinter()— if the address is not an active minter
Implementation Details¶
Mint Ceilings¶
Each minter has a MinterInfo record:
ceiling: maximum total amount the minter is allowed to mintminted: cumulative amount minted so far
mint() reverts if minted + amount > ceiling.
Burning¶
burn()burns frommsg.senderburnFrom()checks allowance and reduces it before burning
Data Structures¶
MinterInfo¶
| Field | Type | Description |
|---|---|---|
| ceiling | uint128 | Maximum amount the minter can mint cumulatively |
| minted | uint128 | Total amount minted by the minter |
Events¶
| Event Name | Description | Parameters |
|---|---|---|
| UpdateMinter | Emitted when minter status is updated | _minter, _status |
| UpdateCeiling | Emitted when minter ceiling is updated | _minter, _ceiling |
Error Conditions¶
| Error Name | Description |
|---|---|
| OnlyMinter | Caller is not a minter |
| MintCeilingExceeded | Mint would exceed ceiling |
| BurnAmountExceedsAllowance | burnFrom amount exceeds allowance |
| ZeroMinterAddress | Attempt to set zero address as minter |
| NotMinter | Attempt to update ceiling for a non-minter |
Access Control Roles¶
| Role / Mechanism | Description |
|---|---|
Owner (Ownable) |
Can manage minters and their ceilings |
Minter (isMinter) |
Can call mint() up to the configured ceiling |
Usage Notes¶
updateMinters()should be called beforeupdateCeiling()(ceiling updates require the address to be an active minter)- A minter's minted total is cumulative; lowering ceilings below
mintedwill prevent further minting until ceilings are raised
Dependencies¶
- OpenZeppelin:
ERC20,Ownable,SafeERC20 - RAAC interfaces:
ILiquidEscrowedRAAC