> 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/reference/contracts/safecertificateconverter.md).

# SafeCertificateConverter

Computes a plan for converting a SAFE Ledger Entry Token (LET) into equity, from a RoundManager's round data.

* **Source:** [`src/converters/SafeCertificateConverter.sol`](https://github.com/MetaLex-Tech/cybercorps-contracts/blob/develop/src/converters/SafeCertificateConverter.sol)
* **Implements:** `ICertificateConverter`

> **Stub.** The body of `computeConversion` is commented out, and the function returns an empty `ConversionPlan`. The intended algorithm is kept in the source as a comment. Do not use this contract for live conversions.

## Interface

```solidity
function computeConversion(
    address roundManager,
    bytes32 roundId,
    address certPrinter,
    uint256 tokenId
) external view returns (ConversionPlan memory plan);
```

## Intended algorithm (from the source comments)

1. Read the source SAFE LET's `investmentAmountUSD` and `issuerUSDValuationAtTimeOfInvestment`.
2. Read round data from the RoundManager: the cap table snapshot's `cCapUsed`, the rounding policy, the round price, and the primary security class and series.
3. Compute the SAFE price as `PMVC / CCap`, and take the lower of the SAFE price and the round price as the price basis.
4. Compute `shares = investmentAmount / priceBasis`, applying the round's rounding policy (floor, ceil or round-half-up).
5. Return a `ConversionPlan` with the share count, price basis, and target class and series.


---

# 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/reference/contracts/safecertificateconverter.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.
