> For the complete documentation index, see [llms.txt](https://docs.metalex.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metalex.tech/protocol-reference/contracts/lexscrowlite.md).

# LeXscroWLite

> **There is no standalone `LeXscroWLite.sol` contract in this repository's `src/` tree.** The escrow layer is implemented as the **`LexScrowStorage` library**, embedded in the deal and round managers.

MetaLeX protocol materials refer to *LeXscroWLite* as the atomic deal-closing escrow. In `cybercorps-contracts` it lives in:

* [`src/storage/LexScrowStorage.sol`](https://github.com/MetaLex-Tech/cybercorps-contracts/blob/develop/src/storage/LexScrowStorage.sol) — the escrow library: `Escrow` / `Token` structs, `EscrowStatus` (`PENDING → PAID → FINALIZED`, or `VOIDED`), per-escrow `ICondition` lists, payment intake (`handleCounterPartyPayment`, with exact-amount checks against fee-on-transfer tokens), `finalizeEscrow` (asset delivery plus platform-fee distribution), `voidAndRefund`, and `conditionCheck`.
* [`src/interfaces/ILexScrowStorage.sol`](https://github.com/MetaLex-Tech/cybercorps-contracts/blob/develop/src/interfaces/ILexScrowStorage.sol) — the shared interface both managers implement so the library's events (`DealPaidAt`, `DealVoidedAt`, `DealFinalizedAt`, `FeeDistributed`) and errors appear in their ABIs.

Both managers expose the escrow surface on their own proxies:

* [`DealManager`](/protocol-reference/contracts/dealmanager.md) escrows payment and certificate effects across a deal's `proposeDeal` → `signDealAndPay` → `finalizeDeal` lifecycle (with `voidExpiredDeal` / `refundVoidedDeal` for stale or voided deals), and runs a parallel `SecondaryEscrow` machinery for secondary-trade settlements.
* [`RoundManager`](/protocol-reference/contracts/roundmanager.md) does the equivalent across `submitEOI` → `allocate` / `reject` / `recallEOI`.

On each, `getEscrowDetails(agreementId)` returns the `Escrow` struct and `conditionCheck(agreementId)` evaluates the attached conditions; both also implement the `onERC721Received` / `onERC1155Received` hooks so assets can be safe-transferred into escrow.

This page will be replaced with a full contract reference if and when a standalone escrow contract lands in `src/`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.metalex.tech/protocol-reference/contracts/lexscrowlite.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
