# BridgeLogic

{% hint style="info" %}
This contract tracks events when liquidity is minted without backing, later backed by another user, and when reserves are enabled as collateral.
{% endhint %}

### Events&#x20;

* **BackUnbacked(reserve, backer, amount, fee)**\
  Emitted when someone **backs previously unbacked liquidity** (assets minted without immediate backing).
  * `reserve`: The asset being backed.
  * `backer`: The address providing the backing liquidity.
  * `amount`: The amount backed.
  * `fee`: The fee paid for backing.

***

* **MintUnbacked(reserve, user, onBehalfOf, amount, referralCode)**\
  Emitted when **unbacked aTokens are minted** for a user (tokens representing liquidity, but not yet matched by reserve funds).
  * `reserve`: The underlying asset.
  * `user`: The address initiating the mint.
  * `onBehalfOf`: The address receiving the minted aTokens.
  * `amount`: The amount of tokens minted.
  * `referralCode`: Optional referral code used for rewards or tracking.

***

* **ReserveUsedAsCollateralEnabled(reserve, user)**\
  Emitted when a user **enables a reserve asset as collateral**.
  * `reserve`: The asset being marked as collateral.
  * `user`: The address of the user enabling it.

```
[
  {
    "anonymous": false,
    "inputs": [
      { "indexed": true, "internalType": "address", "name": "reserve", "type": "address" },
      { "indexed": true, "internalType": "address", "name": "backer", "type": "address" },
      { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" },
      { "indexed": false, "internalType": "uint256", "name": "fee", "type": "uint256" }
    ],
    "name": "BackUnbacked",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      { "indexed": true, "internalType": "address", "name": "reserve", "type": "address" },
      { "indexed": false, "internalType": "address", "name": "user", "type": "address" },
      { "indexed": true, "internalType": "address", "name": "onBehalfOf", "type": "address" },
      { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" },
      { "indexed": true, "internalType": "uint16", "name": "referralCode", "type": "uint16" }
    ],
    "name": "MintUnbacked",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      { "indexed": true, "internalType": "address", "name": "reserve", "type": "address" },
      { "indexed": true, "internalType": "address", "name": "user", "type": "address" }
    ],
    "name": "ReserveUsedAsCollateralEnabled",
    "type": "event"
  }
]


```


---

# 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://colend.gitbook.io/home/abi/bridgelogic.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.
