Bridge Facet (0.8.4)
The Bridge Facet provides an alternative withdrawal pathway within SYMMIO by enabling users to transfer collateral directly to a trusted "bridge" address. This process bypasses the full cooldown period for withdrawals. Once transferred, the designated bridge sends the funds to the user's external wallet. After the cooldown period elapses, the bridge is allowed to withdraw the corresponding funds from SYMMIO. The bridge is responsible for ensuring that users comply with system regulations; if any non-compliant behavior is detected, the bridge transaction can be suspended and later restored with a validated amount.
Currently there are no bridges implemented on SYMMIO.
Overview
The Bridge Facet allows designated addresses—referred to as bridges—to facilitate expedited withdrawals. Users call the transferToBridge
method to initiate a bridge transaction that moves funds from their SYMMIO balance to a bridge. Later, once the cooldown period has passed, the bridge may withdraw the funds. If any wrongdoing is detected, the bridge transaction can be suspended or later restored with a validated amount.
transferToBridge()
Description: Transfers a specified amount of collateral to a designated bridge address. This function bypasses the full cooldown period by immediately moving the requested withdrawal amount into a bridge transaction.
Function Signature:
Parameters:
amount: The amount of collateral to transfer (specified in collateral decimals).
bridgeAddress: The address of the designated bridge. This address must be registered as a valid bridge within the system.
Returns:
A
uint256
transaction ID representing the newly created bridge transaction.
Example:
Events Emitted:
TransferToBridge(address indexed sender, uint256 amount, address indexed bridgeAddress, uint256 transactionId)
The transactionId
emitted from this is used to withdraw from the bridge.
withdrawReceivedBridgeValue()
Description: Allows the designated bridge to withdraw the funds from a specific bridge transaction after the required cooldown period has elapsed. This ensures that the funds can be forwarded to the user's external wallet.
Function Signature:
Parameters:
transactionId: The ID of the bridge transaction from which the funds will be withdrawn.
Example:
Events Emitted:
WithdrawReceivedBridgeValue(uint256 indexed transactionId)
withdrawReceivedBridgeValues
Description: Allows the designated bridge to withdraw funds from multiple bridge transactions in a single call. All specified transactions must meet the cooldown and authorization requirements.
Function Signature:
Parameters:
transactionIds: An array of bridge transaction IDs for which the funds will be withdrawn.
Example:
Events Emitted:
WithdrawReceivedBridgeValues(uint256[] transactionIds)
suspendBridgeTransaction
Description: Suspends a specific bridge transaction. This function is used to halt a withdrawal if suspicious behavior is detected, thereby preventing the bridge from withdrawing the funds.
Function Signature:
Parameters:
transactionId: The ID of the bridge transaction to be suspended.
Example:
Events Emitted:
SuspendBridgeTransaction(uint256 indexed transactionId)
restoreBridgeTransaction
Description: Restores a previously suspended bridge transaction and updates its valid withdrawal amount. This function is typically called after a dispute resolution or verification process confirms that part of the transaction is valid.
Function Signature:
Parameters:
transactionId: The ID of the suspended bridge transaction.
validAmount: The validated amount that will be associated with the restored transaction (must be less than or equal to the original amount).
Example:
Events Emitted:
RestoreBridgeTransaction(uint256 indexed transactionId, uint256 validAmount)
This documentation provides a clear, modular overview of all functions exposed by the Bridge Facet. Each section includes detailed descriptions, usage examples with code snippets, parameter lists, and the events emitted by the function. This format is intended to assist developers in effectively integrating and interacting with the Bridge Facet within the SYMM protocol.
Last updated