This document defines Debt Engine Module for the CMTA Token specification.
This module allows to set an external engine called DebtEngineto configure Debt and Credits Events information.
[TOC]
The interface and struct to represent Debt is available in ICMTAT.sol
This section describes the Ethereum API of Debt Module.
event DebtEngine(IDebtEngine indexed newDebtEngine)Emitted when a new external DebtEngine contract is set.
| Name | Type | Description |
|---|---|---|
newDebtEngine |
IDebtEngine |
Address of the newly assigned debt engine. |
function creditEvents() external view returns(CreditEvents memory creditEvents_)function creditEvents() public view returns (CreditEvents creditEvents_)Returns the current credit events.
- If a
DebtEngineis set, delegates todebtEngine.creditEvents(). - Otherwise, returns the credit events from the base
DebtModule.
| Name | Type | Description |
|---|---|---|
creditEventsResult |
CreditEvents |
The current credit event data structure. |
function debt() external view returns(DebtInformation memory debtInformation_)function debt()
public view virtual override(DebtModule)
returns(DebtInformation memory debtInformation_){Returns the current debt information.
- If a
DebtEngineis set, delegates todebtEngine.debt(). - Otherwise, returns the debt information from the base
DebtModule.
| Name | Type | Description |
|---|---|---|
debtBaseResult |
DebtInformation |
The current debt information structure. |
function debtEngine() public view returns (IDebtEngine)Returns the address of the current DebtEngine.
| Name | Type | Description |
|---|---|---|
debtEngine_ |
IDebtEngine |
The address of the current engine. |
function setDebtEngine(IDebtEngine debtEngine_)
public virtual
onlyRole(DEBT_ROLE)Sets a new external DebtEngine to handle delegated debt and credit logic.
| Name | Type | Description |
|---|---|---|
debtEngine_ |
IDebtEngine |
The new engine contract to delegate to. |
Emits:
- Emits a
DebtEngineevent upon update.
Requirements:
- Only authorized users (DEBT_ROLE) are allowed to call this function.


