Skip to main content

LaminatedStorage

This acts as the storage backbone for LaminatedProxy. It stores the data and state associated with the transactions queued in each LaminatedProxy. This includes the details of the transaction requests and their execution conditions.

Storage mechanism: LaminatedStorage provides a unified storage solution for transaction data across all LaminatedProxy instances.

LaminatedStorage is a contract that serves as storage for LaminatedProxy contracts. It stores data associated with the transactions queued in each LaminatedProxy. It manages queued transaction details and execution conditions using storage slots and mappings.

Overview of Key Storage Slots

The LaminatedStorage contract utilizes several key storage slots to manage and track the state of transactions. These slots include:

  • LAMINATOR_SLOT: This slot is dedicated to storing the address of the Laminator contract, establishing a link between the storage and its creator.
  • OWNER_SLOT: This slot holds the address of the contract's owner, providing control and management capabilities over the contract.
  • SEQUENCE_NUMBER_SLOT: It is used to track the sequence number of messages, ensuring orderly processing of transactions.
  • EXECUTING_SEQUENCE_NUMBER_SLOT: This slot contains the sequence number of the call currently being executed, allowing for tracking of active transactions.
  • EXECUTING_CALL_INDEX_SLOT: It stores the index of the currently executing call within its sequence, aiding in the identification of the call's position.
  • CALL_STATUS_SLOT: This slot indicates the execution status of a call, showing whether a call is currently in progress.

Description of Core Functions

The LaminatedStorage contract provides a set of functions designed to interact with and manage the stored data:

  • deferredCalls: Retrieves the CallObjectHolder for a specific sequence number, allowing access to queued transaction details.
  • cleanupLaminatorStorage: Removes executed calls from storage based on their sequence numbers, helping to maintain an efficient storage state.
  • laminator: Returns the address of the Laminator contract, facilitating interaction between contracts.
  • owner: Provides the address of the contract's owner, ensuring authorized access to contract management functions.
  • nextSequenceNumber: Fetches the next available message sequence number, crucial for queuing new transactions.
  • executingSequenceNumber: Retrieves the sequence number of the call currently under execution, useful for tracking and management.
  • executingCallIndex: Obtains the index of the call currently being executed, aiding in the identification and management of active calls.
  • isCallExecuting: Indicates the execution status of a call, providing a boolean value to show if a call is active.
  • count: Serves as an alias for nextSequenceNumber, offering a count of calls queued in the mempool.
  • _incrementSequenceNumber: A utility function to increment the sequence number after storing a call, ensuring sequence continuity.
  • _setOwner: Assigns the owner's address, intended for a one-time call during contract initialization.
  • _setLaminator: Establishes the Laminator's address, also intended for a single use during setup.
  • _setCurrentlyExecutingSeqNum: Updates the sequence number of the currently executing call, facilitating active call tracking.
  • _setCurrentlyExecutingCallIndex: Updates the index of the currently executing call, aiding in the management of call execution order.
  • _setExecuting: Marks the beginning of a call's execution, transitioning its status to active.
  • _setFree: Signals the completion of a call's execution, updating its status to inactive.

This contract plays a crucial role in ensuring the integrity and orderly execution of transactions managed by LaminatedProxy contracts. It provides a structured and secure way to store and manage transaction data and execution states.