# 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="https://311270402-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F20eavHG09ovQxEkHaAac%2Fuploads%2FBJtSBVF0cOGxE20z9nO4%2Fimage.png?alt=media&#x26;token=539b460a-ba30-4b96-902c-58746fe5ea36" 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**](https://docs.swissborg.com/borg-migration/security) page.

<figure><img src="https://311270402-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F20eavHG09ovQxEkHaAac%2Fuploads%2FahjsAnp4YZbVWjqbRImG%2Fimage.png?alt=media&#x26;token=c73b147e-9136-4222-b0ac-400b04ef6da9" alt=""><figcaption><p>The "pause" process.</p></figcaption></figure>

<figure><img src="https://311270402-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F20eavHG09ovQxEkHaAac%2Fuploads%2F3KGSoBYlfSvFmDBskbSm%2Fimage.png?alt=media&#x26;token=d69df212-b318-4fd0-b45d-03a1938268ee" alt=""><figcaption><p>The "unpause" process.</p></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs.swissborg.com/borg-migration/business-logic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
