Skip to main content

Operational Guidelines

Contract Immutable Values

This document catalogues all immutable values in the contracts:

  1. Deployment-time immutables - Values set during deployment that cannot be updated
  2. Transaction-time immutables - Values set via transactions that cannot be updated or reversed

1. RestrictedLockupToken

Deployment-Time Immutables

VariableTypeLocationDescription
_decimalsuint8L69Token decimals, set in constructor from params.decimals
trustedForwarderaddressERC2771ContextERC2771 trusted forwarder address for meta-transactions
slotsPerWorduint256Storage L82Number of slots per 256-bit word, calculated from maxTotalSupply
elementBitSizeuint256Storage L86Number of bits per element, calculated as 256 / slotsPerWord
maxBalancePerSubIndexuint256Storage L88Maximum balance per sub-index, calculated from slotsPerWord
deploymentDayuint256Storage L95Deployment day rounded to midnight timestamp
minTimelockAmountuint256Storage L53Minimum amount for timelocks
maxReleaseDelayuint256Storage L132Maximum delay for release schedules
snapshotsEnabledboolStorage L54Whether snapshots are enabled (set based on snapshotPeriods address)
recordMintTimestampboolStorage L55Initial state for recording mint timestamps

Contract References (Set Once in Constructor, Upgradeable via Admin)

VariableUpgradeable ByDescription
transferRulesContract AdminTransfer rules contract (upgradeable via upgradeTransferRules)
identityRegistryContract AdminIdentity registry contract (upgradeable via upgradeIdentityRegistry)
accessControlN/AExternal access control (NOT upgradeable after deployment)
snapshotPeriodsN/ASnapshot periods contract (NOT upgradeable after deployment)
restrictedLockupTokenManagementExtensionN/AManagement extension (NOT upgradeable after deployment)
restrictedLockupTokenExtensionN/AExtension contract (NOT upgradeable after deployment)

Transaction-Time Immutables

ValueFunctionDescription
releaseSchedules[id]createReleaseSchedule()Release schedule templates - once created, cannot be modified or deleted
timelocks[address][id].scheduleIdfundReleaseSchedule(), mintReleaseSchedule()Schedule ID assigned to timelock
timelocks[address][id].commencementTimestampfundReleaseSchedule(), mintReleaseSchedule()When the vesting schedule starts
timelocks[address][id].totalAmountfundReleaseSchedule(), mintReleaseSchedule()Total amount in timelock
timelocks[address][id].funderfundReleaseSchedule(), mintReleaseSchedule()Original funder address
timelocks[address][id].cancelableByfundReleaseSchedule(), mintReleaseSchedule()Addresses that can cancel (set once)
globalMintTimestamps[bucket]Mint operationsToken type + days after deployment packed data (entries are immutable once created)
Token minting eventsmint(), mintTokenType()Token minting is irreversible except through burn operations

2. Storage Contract (Shared Storage Layout)

Constants (Compile-Time Immutables)

ConstantValueDescription
MAX_CANCELABLE_BY10Maximum addresses that can cancel a timelock
MAX_TIMELOCKS10,000Maximum timelocks per address
MAX_WALLETS_PER_HOLDER10Maximum wallets per holder
contractVersion"5.1.0"Contract version string
_ITRANSFER_RULES_INTERFACE_IDbytes4ITransferRules interface ID
_IIDENTITY_REGISTRY_INTERFACE_IDbytes4IIdentityRegistry interface ID
TOKEN_TYPE_BITS8Bits for token type (from BitManipulationLib)
TOKEN_TYPE_MASK0xFFMask for token type

3. TransferRules

Deployment-Time Immutables

VariableTypeDescription
INTERFACE_IDbytes4Interface ID for ERC165 support
trustedForwarderaddressERC2771 trusted forwarder
accessControlIAccessControlAccess control contract (NOT upgradeable)

Constants

ConstantValueDescription
SUCCESS0Transfer success code
GREATER_THAN_RECIPIENT_MAX_BALANCE1Error code
SENDER_TOKENS_TIME_LOCKED2Error code
DO_NOT_SEND_TO_TOKEN_CONTRACT3Error code
DO_NOT_SEND_TO_EMPTY_ADDRESS4Error code
SENDER_ADDRESS_FROZEN5Error code
ALL_TRANSFERS_PAUSED6Error code
RECIPIENT_ADDRESS_FROZEN7Error code
LOWER_THAN_RECIPIENT_MIN_BALANCE8Error code
INSUFFICIENT_BALANCE_OF_SENDER9Error code
SENDER_NOT_AMLKYCPASSED10Error code
RECIPIENT_NOT_AMLKYCPASSED11Error code
HOLDING_PERIOD_NOT_MET12Error code
NO_RULE_FOR_RECIPIENT13Error code
RECIPIENT_NOT_QUALIFIED14Error code
MAX_RESTRICTION_CODE14Maximum restriction code
TOKEN_TYPE_GENERIC0Default token type

Error Messages (Set in Constructor)

The errorMessage mapping is initialized in the constructor and cannot be modified:

  • All restriction code messages are permanently set

4. AccessControl / EasyAccessControl

Deployment-Time Immutables

VariableTypeDescription
trustedForwarderaddressERC2771 trusted forwarder

Constants

ConstantValueDescription
CONTRACT_ADMIN_ROLE1 (0x01)Contract admin role bit
RESERVE_ADMIN_ROLE2 (0x02)Reserve admin role bit
WALLETS_ADMIN_ROLE4 (0x04)Wallets admin role bit
TRANSFER_ADMIN_ROLE8 (0x08)Transfer admin role bit
SOFT_BURN_ADMIN_ROLE16 (0x10)Soft burn admin role bit
MINT_ADMIN_ROLE32 (0x20)Mint admin role bit
MAX_ROLE_BIT63 (0x3F)Combined mask of all roles

5. IdentityRegistry

Deployment-Time Immutables

VariableTypeDescription
INTERFACE_IDbytes4Interface ID for ERC165 support
trustedForwarderaddressERC2771 trusted forwarder

Constants

ConstantValueDescription
MAX_REGIONS_COUNT10Maximum regions per identity
MAX_VALIDITY_DURATION100 yearsMaximum AML/KYC validity duration
NO_ACCREDITATION0No accreditation type

6. InterestPayment

Deployment-Time Immutables

VariableTypeDescription
restrictedLockupToken_IRestrictedLockupTokenThe restricted lockup token contract
snapshotPeriodsISnapshotPeriodsSnapshot periods contract
paymentToken_IERC20Payment token (e.g., USDC)
principalAmountPerToken_uint256Principal amount per token for redemption
trustedForwarderaddressERC2771 trusted forwarder

Transaction-Time Immutables

ValueFunctionDescription
paymentPeriods[id].startTimestampcreatePaymentPeriod()Period start time (immutable once created)
paymentPeriods[id].endTimestampcreatePaymentPeriod()Period end time (immutable once created)
interestAccrualStartTimestampConstructorWhen interest starts accruing
interestAccrualEndTimestampConstructorWhen interest stops (can only be extended via shiftInterestAccrualEnd or shortened via earlyRepayment)

Constants

ConstantValueDescription
INTEREST_RATE_PRECISION_FACTOR10^24Precision for interest rate calculations
BIPS_PRECISION10,000,000Basis points precision
MAX_PRINCIPAL_AMOUNT_PER_TOKEN10^47Maximum principal per token
MAX_ABSOLUTE_INTEREST_RATE10^11 (1,000,000%)Maximum interest rate
DURATION_360_DAYS31,104,000 seconds360-day period
DURATION_365_DAYS31,536,000 seconds365-day period
DURATION_366_DAYS31,622,400 seconds366-day period
Role constantsVariousSame as EasyAccessControl

7. PurchaseContract

Deployment-Time Immutables

VariableTypeDescription
interestPaymentIInterestPaymentInterest payment contract (can be address(0))
tokenContractRestrictedLockupTokenThe token contract
paymentTokenIERC20Payment token (e.g., USDC)
trustedForwarderaddressERC2771 trusted forwarder

Transaction-Time Immutables

ValueFunctionDescription
usedPurchaseIds[id]executePurchase(), executePurchaseWithInterest()Purchase IDs can only be marked as used once, never cleared

8. RestrictedSwap

Deployment-Time Immutables

VariableTypeDescription
restrictedLockupTokenRestrictedLockupTokenThe token contract for swaps
INTERFACE_IDbytes4Interface ID for ERC165 support
trustedForwarderaddressERC2771 trusted forwarder
accessControlIAccessControlAccess control contract (NOT upgradeable)

Transaction-Time Immutables

ValueFunctionDescription
Swap configurationconfigureSell(), configureBuy()Once created, swap parameters cannot be modified (only completed or canceled)
_swap[id].restrictedTokenSenderConfigure functionsPermanently set
_swap[id].restrictedTokenAmountConfigure functionsPermanently set
_swap[id].quoteTokenSenderConfigure functionsPermanently set
_swap[id].quoteTokenAmountConfigure functionsPermanently set
_swap[id].quoteTokenConfigure functionsPermanently set
_swap[id].deadlineConfigure functionsPermanently set

9. SnapshotPeriods

Deployment-Time Immutables

VariableTypeDescription
INTERFACE_IDbytes4Interface ID for ERC165 support

Transaction-Time Immutables

ValueFunctionDescription
walletPeriods[token][account][id]onUpdate()Historical period data is append-only
totalSupplyPeriods[token][id]onUpdate()Historical total supply data is append-only

10. RestrictedLockupTokenExtension

Deployment-Time Immutables

VariableTypeDescription
maxTotalSupplyuint256Initial max total supply (used for slotsPerWord calculation)
slotsPerWorduint256Slots per word (must match main contract)
maxBalancePerSubIndexuint256Max balance per sub-index
elementBitSizeuint256Element bit size
trustedForwarderaddressERC2771 trusted forwarder

11. RestrictedLockupTokenManagementExtension

Deployment-Time Immutables

VariableTypeDescription
maxTotalSupplyuint256Initial max total supply (used for slotsPerWord calculation)
slotsPerWorduint256Slots per word (must match main contract)
maxBalancePerSubIndexuint256Max balance per sub-index
elementBitSizeuint256Element bit size
trustedForwarderaddressERC2771 trusted forwarder

Summary by Category

Critical Deployment-Only Immutables (Cannot Be Changed)

  1. Token Configuration

    • _decimals (RestrictedLockupToken)
    • slotsPerWord, elementBitSize, maxBalancePerSubIndex (Storage)
    • deploymentDay (Storage)
  2. Contract References (Non-Upgradeable)

    • accessControl (RestrictedLockupToken, TransferRules, RestrictedSwap)
    • snapshotPeriods (RestrictedLockupToken)
    • restrictedLockupTokenManagementExtension (RestrictedLockupToken)
    • restrictedLockupTokenExtension (RestrictedLockupToken)
    • paymentToken (InterestPayment, PurchaseContract)
    • restrictedLockupToken_ (InterestPayment)
    • tokenContract (PurchaseContract)
  3. ERC2771 Forwarders

    • All trustedForwarder references are immutable
  4. InterestPayment Specifics

    • principalAmountPerToken_ - Determines redemption value per token
    • interestAccrualStartTimestamp - When interest begins

Critical Transaction-Time Immutables (Irreversible Operations)

  1. Vesting & Timelocks

    • releaseSchedules[] - Created once, never deleted
    • timelocks[].scheduleId, .commencementTimestamp, .totalAmount, .funder, .cancelableBy
  2. Token Minting

    • globalMintTimestamps[] - Token type + mint timestamp records
    • All minting operations are irreversible (except via burn)
  3. Interest Payment Periods

    • paymentPeriods[].startTimestamp, .endTimestamp - Define accrual windows
  4. Purchase Records

    • usedPurchaseIds[] - Once used, permanently marked
  5. Swap Records

    • All swap configuration parameters are immutable once created
  6. Historical Data

    • All snapshot period data is append-only and immutable