> For the complete documentation index, see [llms.txt](https://docs.symm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.symm.io/contract-documentation/symmio-perps-v0.8.5/diamond-core-facets/bridge-facet.md).

# Bridge Facet

The Bridge Facet handles the transfer of collateral to and from registered bridge addresses. Users send funds to a bridge for cross-chain movement and claim funds received from a bridge on the destination chain. Administrators can suspend and restore bridge transactions for dispute resolution. The underlying logic is implemented in the `BridgeFacetImpl` library.

{% hint style="info" %}
In v0.8.5, the Bridge Facet is retained alongside the new Withdraw System (see WithdrawFacet). The Withdraw System adds express and virtual providers for cross-chain withdrawals and instant payouts. The Bridge Facet is the direct bridge transfer mechanism; the WithdrawFacet handles the cooldown-based withdrawal flows with provider integration.
{% endhint %}

#### Overview

The Bridge Facet provides:

* **Transfer to Bridge:** Users send collateral from their protocol balance to a registered bridge address, initiating a cross-chain transfer.
* **Withdraw Received Bridge Value:** Users claim funds that have arrived via a bridge transaction on the destination chain.
* **Transaction Suspension:** A suspender role can freeze suspicious bridge transactions pending investigation.
* **Transaction Restoration:** A dispute role can restore suspended transactions with a validated amount, resolving disputes.

***

#### transferToBridge()

Transfers a specified amount of collateral from the caller's balance to a registered bridge address.

**Function Signature:**

```solidity
function transferToBridge(uint256 amount, address bridgeAddress) external whenNotAccountingPaused notSuspended(signer);
```

**Parameters:**

* `amount`: The amount to transfer (in collateral decimals).
* `bridgeAddress`: The address of the registered bridge to receive the funds.

**Example:**

```solidity
// Transfer 500 tokens to a bridge for cross-chain movement
symmioDiamond.transferToBridge(500, bridgeAddress);
```

**Events Emitted:**

* `TransferToBridge(address sender, uint256 amount, address bridgeAddress, uint256 transactionId)`

***

#### withdrawReceivedBridgeValue()

Claims the funds associated with a specific bridge transaction that has been received on this chain.

**Function Signature:**

```solidity
function withdrawReceivedBridgeValue(uint256 transactionId) external whenNotAccountingPaused notSuspended(msg.sender);
```

**Parameters:**

* `transactionId`: The ID of the bridge transaction to claim.

**Example:**

```solidity
// Claim funds from a completed bridge transaction
symmioDiamond.withdrawReceivedBridgeValue(transactionId);
```

**Events Emitted:**

* `WithdrawReceivedBridgeValue(uint256 transactionId)`

***

#### withdrawReceivedBridgeValues()

Claims funds from multiple bridge transactions in a single call.

**Function Signature:**

```solidity
function withdrawReceivedBridgeValues(uint256[] memory transactionIds) external whenNotAccountingPaused notSuspended(msg.sender);
```

**Parameters:**

* `transactionIds`: An array of bridge transaction IDs to claim.

**Events Emitted:**

* `WithdrawReceivedBridgeValues(uint256[] transactionIds)`

***

#### suspendBridgeTransaction()

Suspends a specific bridge transaction, freezing it pending investigation. Only callable by the suspender role.

**Function Signature:**

```solidity
function suspendBridgeTransaction(uint256 transactionId) external onlyRole(SUSPENDER_ROLE);
```

**Parameters:**

* `transactionId`: The ID of the bridge transaction to suspend.

**Access:** Requires `SUSPENDER_ROLE`.

**Events Emitted:**

* `SuspendBridgeTransaction(uint256 transactionId)`

***

#### restoreBridgeTransaction()

Restores a previously suspended bridge transaction with a validated amount. This resolves a dispute by confirming the correct transfer amount, which may differ from the originally reported amount.

**Function Signature:**

```solidity
function restoreBridgeTransaction(uint256 transactionId, uint256 validAmount) external onlyRole(DISPUTE_ROLE);
```

**Parameters:**

* `transactionId`: The ID of the suspended bridge transaction to restore.
* `validAmount`: The validated amount to associate with the restored transaction.

**Access:** Requires `DISPUTE_ROLE`.

**Events Emitted:**

* `RestoreBridgeTransaction(uint256 transactionId, uint256 validAmount)`


---

# 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.symm.io/contract-documentation/symmio-perps-v0.8.5/diamond-core-facets/bridge-facet.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.
