# Contract Architecture

#### Architecture Overview

BIM Exchange with Bungee’s smart contracts act as connectors for various DEXs, aggregators, and bridges. The design emphasizes modularity over upgradability, meaning once deployed, modules are immutable, except in cases where a pause is necessary due to bugs.

When initiating a bridging transaction, users interact with the Registry contract, which decodes transaction data and identifies the necessary steps. If no swap is involved, the route moves directly to bridging. Otherwise, a middleware handles token swaps before passing the process to the respective bridge implementation, completing the transfer to the destination chain.

<figure><img src="/files/cLLsW2ru25VhO0HPzYq0" alt=""><figcaption><p>Bungee archiecture contract</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.bim.finance/faq/bridge/contract-architecture.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.
