Skip to main content

InterestRateFacet

Asset Tokenization Studio Team

InterestRateFacet

Diamond facet that exposes the coupon rate type selector — initialize_InterestRateType, setCouponRateType, and getCouponRateType — under RESOLVER_KEY_INTEREST_RATE.

Inherits InterestRate for business logic and implements IStaticFunctionSelectors for Diamond proxy selector registration.

Methods​

getCouponRateType​

function getCouponRateType() external view returns (enum IInterestRate.RateType)

Returns the stored coupon rate type.

Returns​

NameTypeDescription
_0enum IInterestRate.RateTypeThe RateType value; defaults to STANDARD (0) if never set.

getStaticFunctionSelectors​

function getStaticFunctionSelectors() external pure returns (bytes4[])

Gets all function selectors of a facet

Returns​

NameTypeDescription
_0bytes4[]Face functions selectors

getStaticInterfaceIds​

function getStaticInterfaceIds() external pure returns (bytes4[] staticInterfaceIds_)

Gets all interfaces ids of a facet.

Returns​

NameTypeDescription
staticInterfaceIds_bytes4[]Face interface ids

getStaticResolverKey​

function getStaticResolverKey() external pure returns (bytes32 staticResolverKey_)

Gets the static resolver key

Returns​

NameTypeDescription
staticResolverKey_bytes32Static resolver key

initializeInterestRateType​

function initializeInterestRateType(enum IInterestRate.RateType rateType) external nonpayable

Initializes the coupon rate type during asset deployment.

Intended to be called by the factory immediately after proxy creation. No role required — the factory is trusted at deploy time.

Parameters​

NameTypeDescription
rateTypeenum IInterestRate.RateTypeundefined

setCouponRateType​

function setCouponRateType(enum IInterestRate.RateType rateType) external nonpayable

Sets the coupon rate type discriminator for this asset.

Protected by onlyRole(ROLE_INTEREST_RATE_MANAGER). Reverts with ICoupon.CouponRatePending if any active coupon still has an unresolved rate, so switching away from KPI_LINKED can never strand a pending coupon.

Parameters​

NameTypeDescription
rateTypeenum IInterestRate.RateTypeundefined

Events​

CouponRateTypeSet​

event CouponRateTypeSet(address indexed operator, enum IInterestRate.RateType rateType)

Emitted when the coupon rate type is set (by factory initializer or admin).

Parameters​

NameTypeDescription
operator indexedaddressThe caller who invoked the setter.
rateTypeenum IInterestRate.RateTypeThe RateType value that was selected.

InterestRateTypeInitialized​

event InterestRateTypeInitialized(enum IInterestRate.RateType rateType)

Emitted once when the interest rate type is initialised on a token.

Fires exclusively from initializeInterestRateType after the storage write succeeds.

Parameters​

NameTypeDescription
rateTypeenum IInterestRate.RateTypeThe rate type that was set.

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.

CouponRatePending​

error CouponRatePending(uint256 couponID)

Reverts when at least one coupon is still awaiting rate resolution.

Raised by CouponStorageWrapper.checkPendingCoupons, used to guard InterestRate::setCouponRateType so a KPI-linked coupon cannot be left permanently unresolved by switching the rate type away before its scheduled listing has persisted a resolved rate.

Parameters​

NameTypeDescription
couponIDuint256One-indexed identifier of the first pending coupon found.

Deactivated​

error Deactivated()

Thrown when an operation guarded by onlyActivated is attempted on a token whose deactivation flag has already been set.

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.

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.