Skip to main content

ClearingReadOps

Asset Tokenization Studio Team

ClearingReadOps

Clearing read operations library - deployed once and called via DELEGATECALL

Contains read-only clearing operations with ABAF adjustments

Methods​

checkClearingExpirationTimestamp​

function checkClearingExpirationTimestamp(IClearingTypes.ClearingOperationIdentifier _clearingOperationIdentifier, bool _mustBeExpired, uint256) external view

Parameters​

NameTypeDescription
_clearingOperationIdentifierIClearingTypes.ClearingOperationIdentifierundefined
_mustBeExpiredboolundefined
_2uint256undefined

checkClearingValidExpirationTimestamp​

function checkClearingValidExpirationTimestamp(uint256 _expirationTimestamp, uint256 _blockTimestamp) external pure

Reverts when _expirationTimestamp is not strictly in the future relative to _blockTimestamp.

Parameters​

NameTypeDescription
_expirationTimestampuint256Expiration timestamp supplied by the caller.
_blockTimestampuint256Current block timestamp used as the reference point.

getClearedAmountForAdjustedAt​

function getClearedAmountForAdjustedAt(address _tokenHolder, uint256 _timestamp) external view returns (uint256)

Returns the cleared amount for a token holder, scaled by the ABAF factor at the given timestamp.

Uses ABAF factor to adjust the cleared amount for balance adjustments.

Parameters​

NameTypeDescription
_tokenHolderaddressHolder whose cleared amount is being queried.
_timestampuint256Reference timestamp for the adjustment-factor calculation.

Returns​

NameTypeDescription
_0uint256Adjusted cleared amount at _timestamp.

getClearedAmountForByPartitionAdjustedAt​

function getClearedAmountForByPartitionAdjustedAt(bytes32 _partition, address _tokenHolder, uint256 _timestamp) external view returns (uint256)

Returns the cleared amount for a token holder on a specific partition, scaled by the ABAF factor at the given timestamp.

Uses ABAF factor to adjust the cleared amount for balance adjustments.

Parameters​

NameTypeDescription
_partitionbytes32Partition being queried.
_tokenHolderaddressHolder whose partition cleared amount is being queried.
_timestampuint256Reference timestamp for the adjustment-factor calculation.

Returns​

NameTypeDescription
_0uint256Adjusted partition cleared amount at _timestamp.

getClearingHoldCreationForByPartitionAdjustedAt​

function getClearingHoldCreationForByPartitionAdjustedAt(bytes32 _partition, address _tokenHolder, uint256 _clearingId, uint256 _timestamp) external view returns (struct IClearingTypes.ClearingHoldCreationData clearingHoldCreationData_)

Returns clearing hold-creation data for a specific operation, with the stored amount scaled by the ABAF factor at the given timestamp.

Returns hold creation data with ABAF-adjusted amount.

Parameters​

NameTypeDescription
_partitionbytes32Partition of the clearing operation.
_tokenHolderaddressHolder who initiated the clearing hold creation.
_clearingIduint256Identifier of the clearing operation.
_timestampuint256Reference timestamp for the adjustment-factor calculation.

Returns​

NameTypeDescription
clearingHoldCreationData_IClearingTypes.ClearingHoldCreationDataHold-creation record with the amount adjusted to _timestamp.

getClearingRedeemForByPartitionAdjustedAt​

function getClearingRedeemForByPartitionAdjustedAt(bytes32 _partition, address _tokenHolder, uint256 _clearingId, uint256 _timestamp) external view returns (struct IClearingTypes.ClearingRedeemData clearingRedeemData_)

Returns clearing redeem data for a specific operation, with the stored amount scaled by the ABAF factor at the given timestamp.

Returns redeem data with ABAF-adjusted amount.

Parameters​

NameTypeDescription
_partitionbytes32Partition of the clearing operation.
_tokenHolderaddressHolder who initiated the clearing redeem.
_clearingIduint256Identifier of the clearing operation.
_timestampuint256Reference timestamp for the adjustment-factor calculation.

Returns​

NameTypeDescription
clearingRedeemData_IClearingTypes.ClearingRedeemDataRedeem record with the amount adjusted to _timestamp.

getClearingTransferForByPartitionAdjustedAt​

function getClearingTransferForByPartitionAdjustedAt(bytes32 _partition, address _tokenHolder, uint256 _clearingId, uint256 _timestamp) external view returns (struct IClearingTypes.ClearingTransferData clearingTransferData_)

Returns clearing transfer data for a specific operation, with the stored amount scaled by the ABAF factor at the given timestamp.

Returns transfer data with ABAF-adjusted amount.

Parameters​

NameTypeDescription
_partitionbytes32Partition of the clearing operation.
_tokenHolderaddressHolder who initiated the clearing transfer.
_clearingIduint256Identifier of the clearing operation.
_timestampuint256Reference timestamp for the adjustment-factor calculation.

Returns​

NameTypeDescription
clearingTransferData_IClearingTypes.ClearingTransferDataTransfer record with the amount adjusted to _timestamp.

Errors​

ExpirationDateNotReached​

error ExpirationDateNotReached()

Thrown when an action requires the clearing operation to have expired (e.g., a reclaim attempt) but the expiration timestamp has not yet passed.

ExpirationDateReached​

error ExpirationDateReached()

Thrown when an action requires the clearing operation to still be within its validity window but its expiration timestamp has already passed.

WrongExpirationTimestamp​

error WrongExpirationTimestamp()

Reverts when an expiration timestamp is invalid.

Used for expired, past, or otherwise unacceptable expiration values.