> For the complete documentation index, see [llms.txt](https://docs.swissborg.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.swissborg.com/borg-migration/business-logic.md).

# Business Logic

Initialization

For organization reasons, the SwissBorgToken was created before the Migrator. The deployer of the contracts held the tokens until the migrator was deployed.

## Migration

The exchange rate is:

`1 CHSB = 1 * (10 ** 10) BORG`

This is because the CHSB has **8** decimals, while the BORG has **18** decimals.

To migrate, users will need to first approve the spending of their CHSB by the migrator contract. This can be done through direct contract interaction but will also be implemented on our official frontend.

Then, they will be able to call the migrate function on the contract (again either via contract interaction or through our frontend) passing an amount of CHSB.

This function will take their CHSB and transfer an equivalent amount of BORG according to the exchange rate defined above (in wei).

**Example:**

User A wants to migrate&#x20;

100.000000 (`100000000`) **CHSB**

He will approve the contract and migrate, getting back

100.000000000000000000 (`100000000000000000000`) **BORG**.

<figure><img src="/files/J2oboXbgvQiVqTWzB95Z" alt=""><figcaption><p>The "migrate" process.</p></figcaption></figure>

## Pause

In case of problems, the `manager` might want to pause the migration.

After calling `pause`, any `migrate` transaction must revert.

When decided by the `manager`, the process can be unpaused through the unpause method. After this is called, any transaction calling `migrate` should be working again with the same exchange rate.

For more details about the manager and security in general, you can check the [**Security**](/borg-migration/security.md) page.

<figure><img src="/files/t03WOl4ADcTRzOiuO8Tp" alt=""><figcaption><p>The "pause" process.</p></figcaption></figure>

<figure><img src="/files/TJfIu8IitcIGVM9L6EwI" alt=""><figcaption><p>The "unpause" process.</p></figcaption></figure>


---

# 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.swissborg.com/borg-migration/business-logic.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.
