> For the complete documentation index, see [llms.txt](https://docs.peach.ag/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.peach.ag/documentation/arc/launchpad/launchpad-classic/core-features/emergency-exit.md).

# Emergency Exit

Check activation and redeem tokens after the Factory Owner completes Emergency Exit.

### Check redemption availability

Only the Factory Owner can trigger Emergency Exit, after a launch remains `swept` for seven days from `sweptAt`. The delay alone does not activate redemption. Offer redemption only after the launch reaches `emergencyExited` and its Distributor is deployed and activated.

```ts
const graduation = await client.getGraduation(token);
if (graduation.status !== "emergencyExited") {
  throw new Error("Emergency Exit has not completed");
}
```

### Approve and redeem

After Exit completes, confirm the Distributor state below. Set `tokenIn` to a positive raw token amount. The holder approves the launch token to the Distributor, then previews and submits the redemption.

```ts
const { distributor, deployed } = await client.getEmergencyDistributor({
  launchToken: token,
  quoteToken,
});
if (!deployed) throw new Error("Emergency Exit has not completed");
const exitState = await client.getEmergencyExitState(distributor);
if (!exitState.activated) throw new Error("Redemption is not active");

const approval = await client.prepareApprove({
  asset: token,
  spender: distributor,
  amount: tokenIn,
});
const approvalHash = await client.send(approval);
const approved = await client.wait(approvalHash, { confirmations: chain.confirmations });
if (approved.status !== "confirmed") throw new Error("Approval reverted");

const redemption = await client.prepareEmergencyRedeem({ distributor, tokenIn });
// Show redemption.preview.quoteOut before the user confirms.
const redemptionHash = await client.send(redemption);
const result = await client.wait(redemptionHash, { confirmations: chain.confirmations });
if (result.status !== "confirmed") throw new Error("Redemption reverted");
```

### Understand the payout

Redemption uses the current `totalSupply()`. Burns without redemption increase the payout per remaining token; the final redeemer receives the remainder. Refresh the quote immediately before submission.

Redemption burns the submitted tokens. The contract has no minimum-output parameter; the preview is an estimate. Refresh the quote before signing and display the confirmed payout.


---

# 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.peach.ag/documentation/arc/launchpad/launchpad-classic/core-features/emergency-exit.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.
