Skip to main content

luna.context

Context Objects

@dataclass
class Context()

Dataclass for encapsulating information about the current execution environment in smart contracts.

  • contract_id: The unique identifier of the contract being executed.
  • tick_id: The identifier for the current tick operation.
  • clause: The name of the clause currently being executed.
  • state: The current runtime state of the contract.
  • handle: A handle to the Luna Engine, allowing interaction with the underlying execution engine.

The Context class also defines __enter__ and __exit__ methods for potential use in context management.

contract_id

The unique identifier of the contract.

tick_id

The identifier of the current tick within the contract's lifecycle.

clause

The name of the clause currently being executed within the contract.

state

The current runtime state object of the contract.

handle

A handle to the Luna Engine, facilitating interaction with the execution engine.