Skip to main content

IDividend

Asset Tokenization Studio Team

IDividend

Writer-side interface for the Dividend domain — exposes the corporate-action lifecycle (setDividend, cancelDividend) plus the per-record reads that consumers need before executing or auditing a dividend.

Inherits IDividendTypes for the shared struct tier (Dividend, RegisteredDividend, DividendFor, DividendAmountFor). Domain events and errors live on this writer interface (not on the shared types tier) so that read-only sibling facets such as IDividendSecurityHolders do not pick up symbols they never emit or revert with — a narrow EIP-165 interfaceId is the goal. Aggregated into the off-chain IAsset umbrella alongside the read-only sibling facets.

Methods​

cancelDividend​

function cancelDividend(uint256 _dividendId) external nonpayable returns (bool success_)

Cancels a previously scheduled dividend before its execution date is reached.

Restricted to ROLE_CORPORATE_ACTION and gated by the unpaused state. Reverts with DividendAlreadyExecuted if the execution date has passed; otherwise marks the corporate action disabled and emits DividendCancelled.

Parameters​

NameTypeDescription
_dividendIduint256One-indexed identifier of the dividend to cancel.

Returns​

NameTypeDescription
success_boolTrue if the cancellation was recorded.

forceCancelDividend​

function forceCancelDividend(uint256 _dividendId) external nonpayable returns (bool success_)

Force-cancels a dividend regardless of its execution date.

Restricted to ROLE_CORPORATE_ACTION_FORCE_CANCEL and gated by the unpaused state and onlyMatchingActionType. Marks the corporate action disabled unconditionally — bypasses DividendAlreadyExecuted — and emits DividendForceCancelled.

Parameters​

NameTypeDescription
_dividendIduint256One-indexed identifier of the dividend to force-cancel.

Returns​

NameTypeDescription
success_boolTrue if the force-cancellation was recorded.

getDividend​

function getDividend(uint256 _dividendId) external view returns (struct IDividendTypes.RegisteredDividend registeredDividend_, bool isDisabled_)

Returns the persisted dividend record together with its cancelled flag.

Reverts via onlyMatchingActionType if dividendId does not resolve to a dividend corporate action.

Parameters​

NameTypeDescription
_dividendIduint256One-indexed dividend identifier.

Returns​

NameTypeDescription
registeredDividend_IDividendTypes.RegisteredDividendStored dividend parameters bound to their snapshot id.
isDisabled_boolTrue if the dividend has been cancelled.

getDividendAmountFor​

function getDividendAmountFor(uint256 _dividendId, address _account) external view returns (struct IDividendTypes.DividendAmountFor dividendAmountFor_)

Returns the fractional dividend amount payable to a specific holder.

Reverts via onlyMatchingActionType if dividendId does not resolve to a dividend corporate action. Numerator and denominator are only meaningful once recordDateReached is set on the returned struct.

Parameters​

NameTypeDescription
_dividendIduint256One-indexed dividend identifier.
_accountaddressHolder address to query.

Returns​

NameTypeDescription
dividendAmountFor_IDividendTypes.DividendAmountForFractional payable amount for the holder.

getDividendFor​

function getDividendFor(uint256 _dividendId, address _account) external view returns (struct IDividendTypes.DividendFor dividendFor_)

Returns the per-account view of a dividend, including the holder's balance at the record date and the metadata required to compute the payable amount.

Reverts via onlyMatchingActionType if dividendId does not resolve to a dividend corporate action. Balance and decimals fields are only meaningful once recordDateReached is set on the returned struct.

Parameters​

NameTypeDescription
_dividendIduint256One-indexed dividend identifier.
_accountaddressHolder address to query.

Returns​

NameTypeDescription
dividendFor_IDividendTypes.DividendForHolder-scoped dividend view.

getDividendsCount​

function getDividendsCount() external view returns (uint256 dividendCount_)

Returns the total number of dividends scheduled under the dividend corporate-action type — cancelled dividends remain in the count.

Returns​

NameTypeDescription
dividendCount_uint256Current dividend count.

initializeDividend​

function initializeDividend() external nonpayable

Initialises the dividend capability on the token.

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

setDividend​

function setDividend(IDividendTypes.Dividend _newDividend) external nonpayable returns (uint256 dividendId_)

Parameters​

NameTypeDescription
_newDividendIDividendTypes.Dividendundefined

Returns​

NameTypeDescription
dividendId_uint256undefined

Events​

DividendCancelled​

event DividendCancelled(uint256 dividendId, address indexed operator)

Emitted when an operator cancels a previously scheduled dividend.

Cancellation is rejected once the execution date has passed; see DividendAlreadyExecuted.

Parameters​

NameTypeDescription
dividendIduint256One-indexed identifier of the cancelled dividend.
operator indexedaddressAddress that performed the cancellation.

DividendForceCancelled​

event DividendForceCancelled(uint256 dividendId, address indexed operator)

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

Parameters​

NameTypeDescription
dividendIduint256One-indexed identifier of the force-cancelled dividend.
operator indexedaddressAddress that performed the force-cancellation.

DividendInitialized​

event DividendInitialized()

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

Fires exclusively from initializeDividend.

DividendSet​

event DividendSet(bytes32 corporateActionId, uint256 dividendId, address indexed operator, uint256 indexed recordDate, uint256 indexed executionDate, uint256 amount, uint8 amountDecimals)

Emitted when an operator schedules a new dividend corporate action.

Parameters​

NameTypeDescription
corporateActionIdbytes32Identifier of the underlying corporate action.
dividendIduint256One-indexed dividend identifier within the dividend corporate action type.
operator indexedaddressAddress that scheduled the dividend.
recordDate indexeduint256Unix timestamp of the snapshot taken to determine eligible holders.
executionDate indexeduint256Unix timestamp on which the dividend becomes payable.
amountuint256Total amount distributed across eligible holders, scaled by amountDecimals.
amountDecimalsuint8Decimal precision applied to amount.

Errors​

DividendAlreadyExecuted​

error DividendAlreadyExecuted(bytes32 corporateActionId, uint256 dividendId)

Reverts when an operator attempts to cancel a dividend whose execution date has already passed.

Parameters​

NameTypeDescription
corporateActionIdbytes32Identifier of the underlying corporate action.
dividendIduint256One-indexed identifier of the dividend that cannot be cancelled.

DividendCreationFailed​

error DividendCreationFailed()

Reverts when the underlying corporate-action creation step returns the zero id, indicating the dividend could not be persisted.