Skip to main content

CouponSecurityHolders

Asset Tokenization Studio Team

CouponSecurityHolders

Abstract implementation of ICouponSecurityHolders.

All functions are guarded by onlyMatchingActionType(CORPORATE_ACTION_TYPE_COUPON, …) and delegate storage reads to CouponStorageWrapper.

Methods​

getCouponHolders​

function getCouponHolders(uint256 _couponID, uint256 _pageIndex, uint256 _pageLength) external view returns (address[] holders_)

Returns a paginated list of token holders eligible for a coupon.

Holders are resolved from the snapshot at the coupon record date when one exists; falls back to the live holder list if no snapshot has been taken. Returns an empty array if the record date has not yet been reached.

Parameters​

NameTypeDescription
_couponIDuint256Identifier of the target coupon (1-based index).
_pageIndexuint256Zero-based page number for pagination.
_pageLengthuint256Maximum number of addresses to return per page.

Returns​

NameTypeDescription
holders_address[]Ordered array of holder addresses for the requested page.

getCouponsFor​

function getCouponsFor(uint256 _couponID, uint256 _pageIndex, uint256 _pageLength) external view returns (struct ICouponTypes.CouponFor[] couponFor_, address[] holders_)

Returns coupon information for every holder of a given coupon, paginated.

Internally resolves the holder page then retrieves per-holder coupon details. The two returned arrays share the same index: position i of the first corresponds to the same holder in the second.

Parameters​

NameTypeDescription
_couponIDuint256Identifier of the target coupon (1-based index).
_pageIndexuint256Zero-based page number for pagination.
_pageLengthuint256Maximum number of records to return per page.

Returns​

NameTypeDescription
couponFor_ICouponTypes.CouponFor[]Per-holder coupon details for the requested page.
holders_address[]Holder addresses corresponding to each entry in couponFor_.

getTotalCouponHolders​

function getTotalCouponHolders(uint256 _couponID) external view returns (uint256)

Returns the total number of security holders eligible for a coupon.

Count is taken from the snapshot at the coupon record date when one exists; falls back to the live total if no snapshot has been taken. Returns zero if the record date has not yet been reached.

Parameters​

NameTypeDescription
_couponIDuint256Identifier of the target coupon (1-based index).

Returns​

NameTypeDescription
_0uint256Total number of eligible holders.

initializeCouponSecurityHolders​

function initializeCouponSecurityHolders() external nonpayable

Initialises the coupon security holders capability on the token.

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

Events​

CouponSecurityHoldersInitialized​

event CouponSecurityHoldersInitialized()

Emitted once when the coupon security holders capability is initialised on a token.

Fires exclusively from initializeCouponSecurityHolders.

Errors​

AccountHasNoRole​

error AccountHasNoRole(address account, bytes32 role)

Thrown when an account does not hold a required role.

Parameters​

NameTypeDescription
accountaddressThe account that lacks the role.
rolebytes32The role that is not held.

AssetNotOperational​

error AssetNotOperational(bytes32 configId, uint256 versionId)

Raised by InitializerStorageWrapper.checkOperational (and the related isConfigVersionOperational helper) when an operation is attempted on a configuration version that has not yet been marked operational.

Parameters​

NameTypeDescription
configIdbytes32Resolver-proxy configuration whose operational status was checked.
versionIduint256Configuration version whose operational status was checked.

CouponNotFound​

error CouponNotFound(uint256 couponID)

Reverts when a coupon identifier does not resolve to an existing corporate action.

Parameters​

NameTypeDescription
couponIDuint256The coupon identifier that was not found.

DecimalsTooLarge​

error DecimalsTooLarge(uint8 currentDecimals, uint8 newDecimals)

Reverts when the difference between current decimals and new decimals exceeds the maximum value.

Protects decimals amount difference between current and new not te be greater than maximum.

Parameters​

NameTypeDescription
currentDecimalsuint8the current decimals amount.
newDecimalsuint8the new decimals amount.

ExponentOverflow​

error ExponentOverflow(uint256 exponent)

Reverts when an exponent would cause 10 ** exponent to overflow uint256.

Thrown by DecimalsLib.checkExponentOverflow when exponent >= 78.

Parameters​

NameTypeDescription
exponentuint256The exponent that would produce an overflow.

FacetAlreadyRegistered​

error FacetAlreadyRegistered(bytes32 facetId, uint256 lastVersion)

Raised when an initialiser tries to register a facet that already has a non-zero last registered version (i.e. the facet is being re-initialised on a fresh install).

Parameters​

NameTypeDescription
facetIdbytes32Identifier of the offending facet.
lastVersionuint256Last version recorded for that facet at the time of the check.

GreaterThanMaxUint256​

error GreaterThanMaxUint256(uint256 amount, uint8 decimals)

Reverts when multiplying amount by 10 ** decimals would exceed uint256 max.

Thrown by DecimalsLib.calculateDecimalsAdjustment when amount > MAX_UINT256 / 10 ** decimals.

Parameters​

NameTypeDescription
amountuint256The token amount that cannot be scaled up.
decimalsuint8The exponent that causes the overflow.

SnapshotIdDoesNotExists​

error SnapshotIdDoesNotExists(uint256 snapshotId)

Thrown when the requested snapshot identifier has never been taken on this token.

Parameters​

NameTypeDescription
snapshotIduint256The unrecognised snapshot identifier that was supplied.

SnapshotIdNull​

error SnapshotIdNull()

Thrown when a snapshot identifier of zero is supplied; zero is reserved and never assigned to a valid snapshot.

UnexpectedError​

error UnexpectedError(bytes4 _errorId)

Reverts when an unreachable validation state is detected.

Replaces assertions for defensive handling of logically impossible states.

Parameters​

NameTypeDescription
_errorIdbytes4Identifier of the unexpected validation condition.

UnrecognizedResolverProxyVersion​

error UnrecognizedResolverProxyVersion(bytes8 _resolverProxyVersion)

Thrown when the provided proxy version does not match any BLR compatible standard.

Parameters​

NameTypeDescription
_resolverProxyVersionbytes8proxy version that is not compatible with the BLR.

WalletRecovered​

error WalletRecovered()

Thrown when attempting to recover a wallet that has already been recovered.

WrongIndexForAction​

error WrongIndexForAction(uint256 index, bytes32 actionType)

Thrown when a type-scoped index does not correspond to an existing action.

Parameters​

NameTypeDescription
indexuint256The out-of-range index that was provided.
actionTypebytes32The action type against which the index was validated.