> 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/building-on-the-protocol/how-to.md).

# Guides

What developers can build on the cyberCORPs contracts, which contracts each MetaLeX product uses, and the order to read the guides in

These guides call the cyberCORPs contracts directly. With them you can form a company onchain and issue its securities as Ledger Entry Tokens (LETs), raise money into it, execute agreements through the agreement registry, settle secondary trades on LETs or in scrip, list scrip in an AMM pool, and deploy specialized structures such as an ACE offering or a MetaDAO SPC.

MetaLeX's apps (see [Using the apps](/using-the-apps/webapp.md)) are one front end on these contracts. A script, another dApp or a back-office system can make the same calls, and the contracts do not depend on any MetaLeX app or its backend services.

The code samples use the real signatures from [`cybercorps-contracts`](https://github.com/MetaLex-Tech/cybercorps-contracts) (`develop`) and show the order of calls. Several structs are long, so check every field against the source before you deploy.

## What you need

* [Foundry](https://book.getfoundry.sh/) and a clone of `cybercorps-contracts` on which `forge build` succeeds (the default profile compiles with `via_ir`).
* An RPC endpoint for Base Sepolia and a funded test wallet there, or a local fork of Base Sepolia. None of the guides needs live funds.
* Enough Solidity to read a contract.

## Reading order

Start with the two end-to-end guides. They build the company and the LETs that the task guides start from.

1. [Incorporate a cyberCORP](/building-on-the-protocol/how-to/incorporate-a-cybercorp.md) deploys a company and its contract suite, creates a LET contract for its common stock, and issues the founder's first LET.
2. [Run a cyberRAISE round](/building-on-the-protocol/how-to/run-a-cyberraise-round.md) creates a SAFE round, takes an investor's Expression of Interest, allocates it and closes the round.

Then pick the task you need.

**Issue and control securities**

* [Issue a LET](/building-on-the-protocol/how-to/issue-a-let.md)
* [Scripify and settle a secondary trade](/building-on-the-protocol/how-to/scripify-and-settle.md)
* [Restrict scrip and LET transfers](/building-on-the-protocol/how-to/restrict-transfers.md)
* [Configure BorgAuth roles](/building-on-the-protocol/how-to/configure-roles.md)
* [Gate state transitions with conditions](/building-on-the-protocol/how-to/gate-with-conditions.md)

**Sign agreements and settle trades**

* [Sign a cyberAgreement](/building-on-the-protocol/how-to/sign-a-cyberagreement.md)
* [Run a secondary trade](/building-on-the-protocol/how-to/run-a-secondary-trade.md)
* [Convert SAFEs to equity](/building-on-the-protocol/how-to/convert-safe-to-equity.md)

**Deploy specialized structures**

* [Deploy a PumpCorp for ACE](/building-on-the-protocol/how-to/deploy-pumpcorp-ace.md)
* [Deploy a MetaDAO SPC](/building-on-the-protocol/how-to/deploy-metadao-spc.md)
* [Deploy a LiquiLeX pool](/building-on-the-protocol/how-to/deploy-liquilex-pool.md)

**Operate and integrate**

* [Upgrade a cyberCORP](/building-on-the-protocol/how-to/upgrade-a-cybercorp.md)
* [Integrate from a frontend](/building-on-the-protocol/how-to/integrate-from-frontend.md)

Function-level detail is in the [Reference](/building-on-the-protocol/reference.md), and the design behind it in [How cyberCORPs works](/how-cybercorps-works/explanation.md).

## Which contracts each product uses

| Product        | What it does onchain                                                                            | Contracts                                                                                                                                                                                                                                                                                                                          | Guides                                                                                                                                                                                                                                                                                                                                            |
| -------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| cyberCORPs app | Forms and administers a company: officers, LET contracts, issuance, scrip and transfer controls | `CyberCorpFactory`, `CyberCorp`, `BorgAuth`, [`IssuanceManager`](/building-on-the-protocol/reference/contracts/issuancemanager.md), [`LedgerEntryToken`](/building-on-the-protocol/reference/contracts/ledgerentrytoken.md), [`CyberScrip`](/building-on-the-protocol/reference/contracts/cyberscrip.md)                           | [Incorporate](/building-on-the-protocol/how-to/incorporate-a-cybercorp.md), [Issue a LET](/building-on-the-protocol/how-to/issue-a-let.md), [Roles](/building-on-the-protocol/how-to/configure-roles.md), [Transfers](/building-on-the-protocol/how-to/restrict-transfers.md), [Upgrade](/building-on-the-protocol/how-to/upgrade-a-cybercorp.md) |
| cyberRAISE     | Primary fundraising rounds                                                                      | [`RoundManager`](/building-on-the-protocol/reference/contracts/roundmanager.md), [`DealManager`](/building-on-the-protocol/reference/contracts/dealmanager.md), [`LeXscroWLite`](/building-on-the-protocol/reference/contracts/lexscrowlite.md)                                                                                    | [Run a cyberRAISE round](/building-on-the-protocol/how-to/run-a-cyberraise-round.md)                                                                                                                                                                                                                                                              |
| cyberTRADE     | Settlement of negotiated secondary trades                                                       | [`DealManager`](/building-on-the-protocol/reference/contracts/dealmanager.md), [`LeXscroWLite`](/building-on-the-protocol/reference/contracts/lexscrowlite.md), [`IssuanceManager`](/building-on-the-protocol/reference/contracts/issuancemanager.md), [`CyberScrip`](/building-on-the-protocol/reference/contracts/cyberscrip.md) | [Run a secondary trade](/building-on-the-protocol/how-to/run-a-secondary-trade.md), [Scripify and settle](/building-on-the-protocol/how-to/scripify-and-settle.md)                                                                                                                                                                                |
| cyberSign      | Agreement templates and multi-party execution                                                   | [`CyberAgreementRegistry`](/building-on-the-protocol/reference/contracts/cyberagreementregistry.md)                                                                                                                                                                                                                                | [Sign a cyberAgreement](/building-on-the-protocol/how-to/sign-a-cyberagreement.md)                                                                                                                                                                                                                                                                |
| ACE            | Token-community conversion into equity                                                          | [`PumpCorpFactory`](/building-on-the-protocol/reference/factories.md), [`ACESAFEExtension`](/building-on-the-protocol/reference/extensions.md)                                                                                                                                                                                     | [Deploy a PumpCorp for ACE](/building-on-the-protocol/how-to/deploy-pumpcorp-ace.md)                                                                                                                                                                                                                                                              |
| LiquiLeX       | AMM liquidity for scrip                                                                         | [`MetalexIssuerFeeHook`](/building-on-the-protocol/reference/hooks.md) on Uniswap v4, [`CyberScrip`](/building-on-the-protocol/reference/contracts/cyberscrip.md)                                                                                                                                                                  | [Deploy a LiquiLeX pool](/building-on-the-protocol/how-to/deploy-liquilex-pool.md)                                                                                                                                                                                                                                                                |
| MetaDAO        | Futarchy-governed Cayman SPC                                                                    | [`MetaDAOFactory`](/building-on-the-protocol/reference/factories.md)                                                                                                                                                                                                                                                               | [Deploy a MetaDAO SPC](/building-on-the-protocol/how-to/deploy-metadao-spc.md)                                                                                                                                                                                                                                                                    |
| LeXcheX        | Soulbound accreditation and KYC/AML credentials                                                 | [`LexChex`, `LeXcheXBadge`, `LexChexMinter`](/building-on-the-protocol/reference/contracts/lexchex.md)                                                                                                                                                                                                                             | [Gate state transitions with conditions](/building-on-the-protocol/how-to/gate-with-conditions.md)                                                                                                                                                                                                                                                |

### cyberRAISE

Issuers configure rounds with raise caps, ticket sizes, pricing, payment tokens (typically USDC), security types (SAFE, SAFT, SAFTE and equity rounds) and a round mode: first-come or founder-approved. Investors submit EIP-712-signed Expressions of Interest, the round and deal managers hold their payments in escrow, and allocation mints the investors' LETs.

### cyberTRADE

cyberTRADE settles secondary trades of fund interests, LLC membership interests, LP units, private company stock and other private securities, in US and non-US jurisdictions. The parties find each other and negotiate elsewhere. cyberTRADE verifies compliance, executes the agreement, holds escrow and settles atomically, along one of two paths:

* **LET path.** The DealManager's offer flow. At settlement the seller's LET is reduced or used up, and a new LET carrying the seller's endorsement is minted to the buyer. The buyer elects an exemption pathway (Rule 144, §4(a)(7), §4(a)(1½), Rule 144A or Regulation S), and the trade must pass that pathway's conditions plus the issuer's own: holder caps, accreditation, qualified-purchaser status, holding periods, jurisdiction screens and, where the issuer installs one, a per-deal approval condition. Settlements pay the DealManager's secondary fee, which is set separately from the primary fee on rounds and deals.
* **Scrip path.** Settlement in scrip, with conversion back into a LET deferred until the holder asks for it. LiquiLeX pools run on this path.

### cyberSign

Anyone can register a template in the `CyberAgreementRegistry`, and a standalone agreement creates its template in the same transaction. Parties countersign onchain with EIP-712 signatures, and executed agreements are linked to LETs and deal records. cyberSign works as a signing layer for any legal instrument, with or without a raise.

### LiquiLeX

LiquiLeX pairs a company's scrip against a stablecoin in a Uniswap v4 pool whose `MetalexIssuerFeeHook` routes swap fees to MetaLeX and the issuer. A whitelisted pool lets only whitelisted addresses hold or move the scrip. An open pool enforces compliance when scrip converts back into a LET, optionally with a zkPassport check at the swap.

### LeXcheX

LeXcheX issues soulbound credentials: the original accreditation NFT and the `LeXcheXBadge` registry, which covers accreditation, qualified-purchaser and QIB status, jurisdiction and beneficial-owner attestations, and per-issuer whitelists. Conditions read these credentials to gate rounds and trades.

## Where the reference front ends live

MetaLeX's reference front ends are in the [`metalex-webapp`](https://github.com/MetaLex-Tech/metalex-webapp) monorepo:

| Product        | Route                                                              | Source                                                                                                                                                                                                                                  |
| -------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| cyberCORPs app | `/cybercorps`                                                      | [`apps/cybercorps-web/src/app/(frame-layout)/cybercorps`](https://github.com/MetaLex-Tech/metalex-webapp/tree/develop/apps/cybercorps-web/src/app/%28frame-layout%29/cybercorps)                                                        |
| cyberRAISE     | `/cyberraise`                                                      | [`apps/cybercorps-web/src/app/(frame-layout)/cyberraise`](https://github.com/MetaLex-Tech/metalex-webapp/tree/develop/apps/cybercorps-web/src/app/%28frame-layout%29/cyberraise)                                                        |
| ACE            | `/ace`, with `/ace/bridge-to-solana` and `/ace/bridge-from-solana` | [`apps/cybercorps-web/src/app/ace`](https://github.com/MetaLex-Tech/metalex-webapp/tree/develop/apps/cybercorps-web/src/app/ace)                                                                                                        |
| cyberSign      | `/cybersign`                                                       | [`apps/web/src/app/(frame-layout)/cybersign`](https://github.com/MetaLex-Tech/metalex-webapp/tree/develop/apps/web/src/app/%28frame-layout%29/cybersign)                                                                                |
| MetaDAO        | `/metadao`                                                         | [`apps/cybercorps-web/src/app/(frame-layout)/metadao`](https://github.com/MetaLex-Tech/metalex-webapp/tree/develop/apps/cybercorps-web/src/app/%28frame-layout%29/metadao)                                                              |
| LeXcheX        | lexchex.metalex.tech                                               | [`apps/lexchex-web`](https://github.com/MetaLex-Tech/metalex-webapp/tree/develop/apps/lexchex-web), with the oracle service in [`apps/lexchex-oracle`](https://github.com/MetaLex-Tech/metalex-webapp/tree/develop/apps/lexchex-oracle) |

The cyberCORPs app's **cyberSign** sidebar entry opens cyberSign. The app works with v4 and v5 companies side by side and chooses each call's shape from the targeted contract's `DEPLOY_VERSION`; [Integrate from a frontend](/building-on-the-protocol/how-to/integrate-from-frontend.md) shows how to do the same.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.metalex.tech/building-on-the-protocol/how-to.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
