Skip to main content

IAmortization

Asset Tokenization Studio Team

IAmortization

Writer interface for the amortization facet — corporate-action driven token redemption.

Defines the events, errors, structs, and functions used to register, fund, hold, and cancel amortization corporate actions across the token holder set.

Methods​

cancelAmortization​

function cancelAmortization(uint256 _amortizationID) external nonpayable

Cancels an existing amortization.

Reverts if any token holder still has an active hold for this amortization. All holds must be released via releaseAmortizationHold before cancellation is allowed.

Parameters​

NameTypeDescription
_amortizationIDuint256The ID of the amortization to cancel.

forceCancelAmortization​

function forceCancelAmortization(uint256 _amortizationID) external nonpayable

Force-cancels an amortization regardless of its execution date.

Restricted to ROLE_CORPORATE_ACTION_FORCE_CANCEL and gated by the unpaused state, onlyWithoutMultiPartition, and onlyMatchingActionType. Marks the corporate action disabled unconditionally — bypasses AmortizationAlreadyExecuted and AmortizationNotActive — and emits AmortizationForceCancelled.

Parameters​

NameTypeDescription
_amortizationIDuint256The ID of the amortization to force-cancel.

getActiveAmortizationIds​

function getActiveAmortizationIds(uint256 _pageIndex, uint256 _pageLength) external view returns (uint256[] activeIds_)

Retrieves a paginated list of non-cancelled amortization IDs.

Cancelled amortizations (isDisabled=true) are excluded from the result.

Parameters​

NameTypeDescription
_pageIndexuint256The page index for pagination.
_pageLengthuint256The number of records per page.

Returns​

NameTypeDescription
activeIds_uint256[]Array of amortization IDs that have not been cancelled.

getAmortization​

function getAmortization(uint256 _amortizationID) external view returns (struct IAmortization.RegisteredAmortization registeredAmortization_, bool isDisabled_)

Retrieves a registered amortization by its ID.

Parameters​

NameTypeDescription
_amortizationIDuint256The ID of the amortization to retrieve.

Returns​

NameTypeDescription
registeredAmortization_IAmortization.RegisteredAmortizationThe registered amortization data.
isDisabled_boolWhether the amortization is disabled.

getAmortizationActiveHolders​

function getAmortizationActiveHolders(uint256 _amortizationID, uint256 _pageIndex, uint256 _pageLength) external view returns (address[] holders_)

Retrieves a paginated list of token holders that still have an active hold for a given amortization.

Use this to identify which holders must have their hold released before cancelAmortization can succeed.

Parameters​

NameTypeDescription
_amortizationIDuint256The ID of the amortization.
_pageIndexuint256The page index for pagination.
_pageLengthuint256The number of holders per page.

Returns​

NameTypeDescription
holders_address[]Array of addresses with an active hold for this amortization.

getAmortizationFor​

function getAmortizationFor(uint256 _amortizationID, address _account) external view returns (struct IAmortization.AmortizationFor amortizationFor_)

Retrieves amortization payment information for a specific account.

Parameters​

NameTypeDescription
_amortizationIDuint256The ID of the amortization.
_accountaddressThe account address.

Returns​

NameTypeDescription
amortizationFor_IAmortization.AmortizationForAmortization payment information for the specified account.

getAmortizationHolders​

function getAmortizationHolders(uint256 _amortizationID, uint256 _pageIndex, uint256 _pageLength) external view returns (address[] holders_)

Retrieves a paginated list of amortization holders for a specific amortization ID.

Parameters​

NameTypeDescription
_amortizationIDuint256The ID of the amortization.
_pageIndexuint256The page index for pagination.
_pageLengthuint256The number of holders per page.

Returns​

NameTypeDescription
holders_address[]Array of holder addresses.

getAmortizationsCount​

function getAmortizationsCount() external view returns (uint256 amortizationCount_)

Retrieves the total number of amortizations set for the security.

Cancelled amortizations are included in the count.

Returns​

NameTypeDescription
amortizationCount_uint256The total count of registered amortizations.

getAmortizationsFor​

function getAmortizationsFor(uint256 _amortizationID, uint256 _pageIndex, uint256 _pageLength) external view returns (struct IAmortization.AmortizationFor[] amortizationsFor_, address[] holders_)

Retrieves amortization payment information for multiple holders (paginated).

Parameters​

NameTypeDescription
_amortizationIDuint256The ID of the amortization.
_pageIndexuint256The page index for pagination.
_pageLengthuint256The number of records per page.

Returns​

NameTypeDescription
amortizationsFor_IAmortization.AmortizationFor[]List of amortization payment information per holder.
holders_address[]The holder addresses aligned by index with amortizationsFor_.

getTotalActiveAmortizationIds​

function getTotalActiveAmortizationIds() external view returns (uint256)

Retrieves the total number of non-cancelled amortizations.

Returns​

NameTypeDescription
_0uint256The total count of active (non-cancelled) amortization IDs.

getTotalAmortizationActiveHolders​

function getTotalAmortizationActiveHolders(uint256 _amortizationID) external view returns (uint256)

Retrieves the total number of token holders that still have an active hold for a given amortization.

Parameters​

NameTypeDescription
_amortizationIDuint256The ID of the amortization.

Returns​

NameTypeDescription
_0uint256The total count of holders with an active hold.

getTotalAmortizationHolders​

function getTotalAmortizationHolders(uint256 _amortizationID) external view returns (uint256)

Retrieves the total number of amortization holders for a specific amortization ID.

It is the list of token holders at the snapshot taken at the record date.

Parameters​

NameTypeDescription
_amortizationIDuint256The ID of the amortization.

Returns​

NameTypeDescription
_0uint256The total number of amortization holders.

getTotalHoldByAmortizationId​

function getTotalHoldByAmortizationId(uint256 _amortizationID) external view returns (uint256)

Retrieves the total amount of tokens locked in holds for a given amortization.

Parameters​

NameTypeDescription
_amortizationIDuint256The ID of the amortization.

Returns​

NameTypeDescription
_0uint256The total token amount held across all active holds for this amortization.

initializeAmortization​

function initializeAmortization() external nonpayable

Initialises the amortization capability on the token.

Callable once; subsequent calls revert with FacetAlreadyRegistered. Requires DEFAULT_ADMIN_ROLE. Called by the factory during deployment.

isAmortizationHoldAccountingMigrationPending​

function isAmortizationHoldAccountingMigrationPending(uint256 _amortizationID) external view returns (bool)

Reports whether an amortization corporate action still needs migrateAmortizationHoldAccounting to be called for it.

Backed by the same raw-LABAF-read helper as the idempotency guard on the migration writer, depending only on labafByAmortizationId == 0 — never on totalHoldByAmortizationId. No role gate, matching the read-only nature of getTotalHoldByAmortizationId.

Parameters​

NameTypeDescription
_amortizationIDuint256The one-based identifier of the amortization to inspect.

Returns​

NameTypeDescription
_0boolTrue if the raw labafByAmortizationId is still 0 (never migrated and never regularly synced); false otherwise.

migrateAmortizationHoldAccounting​

function migrateAmortizationHoldAccounting(uint256 _amortizationID, uint256 _total, uint256 _labaf) external nonpayable

One-time, admin-gated repair that seeds totalHoldByAmortizationId and labafByAmortizationId for an amortization corporate action that accumulated holds before LABAF tracking existed on this aggregate.

Restricted to DEFAULT_ADMIN_ROLE. Deliberately carries no onlyOperational, onlyActivated, or onlyUnpaused gate so it can repair state while the token is paused. Reverts with {AmortizationHoldAccountingAlreadyMigrated} if the raw, non-defaulted labafByAmortizationId is already non-zero; with {InvalidAmortizationMigrationLabaf} if _labaf == 0; with {AmortizationMigrationLabafAboveAbaf} if _labaf exceeds the current ABAF; with {AmortizationMigrationTotalAboveSupply} if _total exceeds the token's current total supply. Not gated on disabledAmortizations: a cancelled action can still reach the vulnerable sync path via a later releaseAmortizationHold and must stay migratable. Emits {AmortizationHoldAccountingMigrated} on success.

Parameters​

NameTypeDescription
_amortizationIDuint256The one-based identifier of the amortization to migrate.
_totaluint256The raw totalHoldByAmortizationId value to seed (no lower bound, 0 is valid; MUST NOT exceed the token's current totalSupply()).
_labafuint256The raw labafByAmortizationId value to seed; must satisfy 0 < _labaf <= currentAbaf.

releaseAmortizationHold​

function releaseAmortizationHold(uint256 _amortizationID, address _tokenHolder) external nonpayable

Releases the active hold for a specific token holder in an amortization.

Must be called for every holder with an active hold before cancelAmortization can succeed. Reverts if the holder has no active hold for this amortization.

Parameters​

NameTypeDescription
_amortizationIDuint256The ID of the amortization.
_tokenHolderaddressThe address of the token holder whose hold will be released.

setAmortization​

function setAmortization(IAmortization.Amortization _amortization) external nonpayable returns (bool success_, uint256 amortizationID_)

Parameters​

NameTypeDescription
_amortizationIAmortization.Amortizationundefined

Returns​

NameTypeDescription
success_boolundefined
amortizationID_uint256undefined

setAmortizationHold​

function setAmortizationHold(uint256 _amortizationID, address _tokenHolder, uint256 _tokenAmount) external nonpayable returns (uint256 holdId_)

Creates or replaces the hold for a specific token holder in an amortization.

If the holder already has a pending hold, it is released first.

Parameters​

NameTypeDescription
_amortizationIDuint256The ID of the amortization.
_tokenHolderaddressThe address of the token holder.
_tokenAmountuint256The number of tokens to lock in the hold.

Returns​

NameTypeDescription
holdId_uint256The ID of the newly created hold.

Events​

AmortizationCancelled​

event AmortizationCancelled(uint256 amortizationId, address indexed operator)

Emitted when an amortization is cancelled.

Parameters​

NameTypeDescription
amortizationIduint256Identifier of the cancelled amortization.
operator indexedaddressAddress that performed the cancellation.

AmortizationForceCancelled​

event AmortizationForceCancelled(uint256 amortizationId, address indexed operator)

Emitted when an admin force-cancels an amortization, bypassing date guards.

Parameters​

NameTypeDescription
amortizationIduint256Identifier of the force-cancelled amortization.
operator indexedaddressAddress that performed the force-cancellation.

AmortizationHoldAccountingMigrated​

event AmortizationHoldAccountingMigrated(bytes32 indexed corporateActionId, uint256 indexed amortizationID, uint256 previousTotal, uint256 previousLabaf, uint256 total, uint256 labaf)

Emitted when the pre-fix hold-accounting state of an amortization corporate action is seeded by migrateAmortizationHoldAccounting.

Carries both the pre-migration stored values and the newly seeded ones so the migration is self-contained for audit purposes.

Parameters​

NameTypeDescription
corporateActionId indexedbytes32Unique identifier grouping related corporate actions.
amortizationID indexeduint256Identifier of the migrated amortization.
previousTotaluint256The raw totalHoldByAmortizationId stored before migration.
previousLabafuint256The raw labafByAmortizationId stored before migration (always 0).
totaluint256The totalHoldByAmortizationId seeded by this migration.
labafuint256The labafByAmortizationId seeded by this migration.

AmortizationHoldReleased​

event AmortizationHoldReleased(bytes32 indexed corporateActionId, uint256 indexed amortizationID, address indexed tokenHolder, uint256 holdId)

Emitted when a hold is released for a token holder in an amortization.

Parameters​

NameTypeDescription
corporateActionId indexedbytes32Unique identifier grouping related corporate actions.
amortizationID indexeduint256Identifier of the amortization.
tokenHolder indexedaddressAddress of the token holder whose hold was released.
holdIduint256ID of the released hold.

AmortizationHoldSet​

event AmortizationHoldSet(bytes32 indexed corporateActionId, uint256 indexed amortizationID, address indexed tokenHolder, uint256 holdId, uint256 tokenAmount)

Emitted when a hold is created or replaced for a token holder in an amortization.

Parameters​

NameTypeDescription
corporateActionId indexedbytes32Unique identifier grouping related corporate actions.
amortizationID indexeduint256Identifier of the amortization.
tokenHolder indexedaddressAddress of the token holder.
holdIduint256ID of the newly created hold.
tokenAmountuint256Amount of tokens locked in the hold.

AmortizationInitialized​

event AmortizationInitialized()

Emitted once when the amortization capability is initialised on a token.

Fires exclusively from initializeAmortization.

AmortizationSet​

event AmortizationSet(bytes32 corporateActionId, uint256 amortizationId, address indexed operator, uint256 recordDate, uint256 executionDate)

Emitted when an amortization is created or updated for a security.

Parameters​

NameTypeDescription
corporateActionIdbytes32Unique identifier grouping related corporate actions.
amortizationIduint256Identifier of the created or updated amortization.
operator indexedaddressAddress that performed the operation.
recordDateuint256Date at which token holder balances are snapshotted.
executionDateuint256Date at which the amortization payment is executed.

Errors​

AmortizationAlreadyExecuted​

error AmortizationAlreadyExecuted(bytes32 corporateActionId, uint256 amortizationId)

Amortization execution failed because the amortization has already been executed.

Parameters​

NameTypeDescription
corporateActionIdbytes32The corporate action ID of the already-executed amortization.
amortizationIduint256The amortization ID that was already executed.

AmortizationCreationFailed​

error AmortizationCreationFailed()

Amortization creation failed due to an internal failure.

AmortizationHasActiveHolds​

error AmortizationHasActiveHolds(bytes32 corporateActionId, uint256 amortizationID)

Thrown when attempting to cancel an amortization that still has active holds.

Parameters​

NameTypeDescription
corporateActionIdbytes32The corporate action ID of the amortization.
amortizationIDuint256The amortization ID that still has pending holds.

AmortizationHoldAccountingAlreadyMigrated​

error AmortizationHoldAccountingAlreadyMigrated(bytes32 corporateActionId, uint256 amortizationID)

Thrown by migrateAmortizationHoldAccounting when the target amortization's raw, non-defaulted labafByAmortizationId is already non-zero.

The migration is a one-time contingency, not a setter; a non-zero raw LABAF means the amortization was already migrated or has already gone through a regular sync.

Parameters​

NameTypeDescription
corporateActionIdbytes32Unique identifier grouping related corporate actions.
amortizationIDuint256The amortization ID that was already migrated.

AmortizationHoldFailed​

error AmortizationHoldFailed(bytes32 corporateActionId, uint256 amortizationID)

Thrown when creating a hold for an amortization fails.

Parameters​

NameTypeDescription
corporateActionIdbytes32The corporate action ID of the amortization.
amortizationIDuint256The amortization ID for which hold creation failed.

AmortizationHoldNotActive​

error AmortizationHoldNotActive(bytes32 corporateActionId, uint256 amortizationID, address tokenHolder)

Thrown when attempting to release a hold that is not active for the given holder.

Parameters​

NameTypeDescription
corporateActionIdbytes32The corporate action ID of the amortization.
amortizationIDuint256The amortization ID.
tokenHolderaddressThe address of the token holder with no active hold.

AmortizationMigrationLabafAboveAbaf​

error AmortizationMigrationLabafAboveAbaf(uint256 amortizationID, uint256 labaf, uint256 abaf)

Thrown by migrateAmortizationHoldAccounting when _labaf exceeds the current ABAF.

A _labaf above the current ABAF would truncate abaf / labaf to 0 on the next sync.

Parameters​

NameTypeDescription
amortizationIDuint256The amortization ID being migrated.
labafuint256The invalid, out-of-range _labaf supplied by the caller.
abafuint256The current ABAF the supplied _labaf was compared against.

AmortizationMigrationTotalAboveSupply​

error AmortizationMigrationTotalAboveSupply(uint256 amortizationID, uint256 total, uint256 totalSupply)

Thrown by migrateAmortizationHoldAccounting when _total exceeds the token's current total supply.

_An unbounded _total would eventually overflow the checked total _= factor arithmetic on the next resync, permanently bricking amortization hold operations (including release) for that corporate action, since the migration is one-shot.*

Parameters​

NameTypeDescription
amortizationIDuint256The amortization ID being migrated.
totaluint256The invalid, out-of-range _total supplied by the caller.
totalSupplyuint256The current total supply that _total was compared against.

AmortizationNotActive​

error AmortizationNotActive(bytes32 corporateActionId, uint256 amortizationID)

Thrown when attempting to operate on a cancelled amortization.

Parameters​

NameTypeDescription
corporateActionIdbytes32The corporate action ID of the amortization.
amortizationIDuint256The amortization ID.

InvalidAmortizationHoldAmount​

error InvalidAmortizationHoldAmount(uint256 amortizationID)

Thrown when attempting to set a hold with a zero token amount.

Parameters​

NameTypeDescription
amortizationIDuint256The amortization ID.

InvalidAmortizationMigrationLabaf​

error InvalidAmortizationMigrationLabaf(uint256 amortizationID)

Thrown by migrateAmortizationHoldAccounting when _labaf is 0.

A zero _labaf would recreate the very "never held" ambiguity this migration exists to resolve, since the getter defaults a raw 0 to 1 via zeroToOne.

Parameters​

NameTypeDescription
amortizationIDuint256The amortization ID being migrated.