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

# SafeCertificateConverter

Computes a conversion plan for converting a SAFE certificate into equity, based on round data from a RoundManager.

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

> **Currently a stub.** In the present source, the body of `computeConversion` is commented out and the function returns an empty `ConversionPlan`. The intended algorithm is preserved in the source as a comment. Do not rely on this contract for live conversions yet.

## 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 cert'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/series.
3. Compute the SAFE price as `PMVC / CCap`, 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 / round-half-up).
5. Return a `ConversionPlan` with the share count, price basis, and target class/series.

When the implementation is completed, this page will be updated with the exact `ConversionPlan` shape and behaviour.


---

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