Contracts
Synapse RFQ
The Synapse RFQ contract source code can be found here along with generated documentation here
Chain | Address |
---|---|
Arbitrum | |
Base | |
Ethereum | |
Optimism | |
Scroll | |
Linea | |
BNB Chain | |
Blast |
On-Chain Architecture & Transaction Flow
The RFQ contract allows users to post bridge requests based on quotes they have received from the solvers. At a high level, the contract works as follows:
User calls bridge: The user calls the bridge contract with the quote they have received from the RFQ API and passing in origin, destination and other paramaters as a BridgeParam.
Bridge emits event: The bridge contract emits a
BridgeRequested
event.Solver Calls Prove: The solver then calls the
prove
function on the RFQ contract to prove they have filled the order. In the current implementation, the function must be called from the solver address.User Claims: If the solver does not call prove within the optimistic window, the user can call the
claim
function to claim their funds back.
On-Chain Statuses
Like the relayer, each transaction in the RFQ contract has a status. The statuses are as follows:
Status | Int | Meaning |
---|---|---|
Null | 0 | Bridge transaction doesn't exist yet on the origin chain. |
Requested | 1 | A bridge has been requested, but the |
Relayer Proved | 2 | The relayer has tried to |
Relayer Claimed | 3 | The relayer has called |
Refunded | 4 | The relayer has not called |
Dispute Period and Guards
The RFQ system includes a dispute period and guards to ensure the integrity of bridge transactions. Here's how it works:
After a relayer submits a proof for a bridge transaction, there's a set period during which the transaction can be disputed. This period allows for detection and correction of any errors or fraudulent activities. Guards are responsible for monitoring bridge transactions and initiating disputes if they detect issues such as incorrect fill amounts and proofs submitted by the wrong relayer. A successful dispute would end up with the relayer losing their claimable funds.
The current implementation is architectured to enforce honest behavior and also protect honest relayers in cases of blockchain reorgs.
Other Functionalities
ChainGas
sendChainGas
is a field that is populated by the bridge user, and it's a simple bool flag. If sendChainGas=true
the amount is specified in the FastBridge contract on the destination chain as chainGasAmount
. This is currently set to zero in all the contracts, and can thus be ignored by filling orders with either no sendChainGas
option (or to chains with chainGasAmount==0
)
Last updated