> 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>
