You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/express-relay/integrate-as-protocol.mdx
+40-5Lines changed: 40 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
import { Steps } from'nextra/components'
2
+
1
3
# How to Integrate Express Relay as a Protocol
2
4
3
5
This guide explains how to integrate Express Relay as a protocol.
@@ -39,13 +41,16 @@ Then add the following line to `remappings.txt` file:
39
41
40
42
### Modifying the Protocol's Contract
41
43
44
+
The protocol's contract needs to be updated to:
45
+
46
+
1. Consume `isPermissioned` method from `IExpressRelay` interface to Permit Express Relay transactions.
47
+
1. Implement the `IExpressRelayFeeReceiver` interface to receive funds from Express Relay.
42
48
43
-
`IExpressRelay` interface exposes the `isPermissioned` function to check if Express Relay can liquidate a position.
49
+
#### Permit Express Relay Transactions
44
50
45
51
The `isPermissioned` function takes two arguments:
46
52
1.`protocolFeeReceiver`: The address of the protocol's contract. If the protocol's contract is the contract that receives fees from the Express Relay server, this should be the address of that contract. (IS IT WORTH MENTIONING HERE????)
47
-
2.`permissionId`: A unique identifier for the liquidation opportunity.
48
-
53
+
1.`permissionId`: A unique identifier for the liquidation opportunity.
The `IExpressRelayFeeReceiver` interface requires the protocol's contract to implement the `receiveAuctionProceedings` function. The Express Relay server calls this function to send funds to the protocol's contract.
75
+
76
+
```solidity copy
77
+
interface IExpressRelayFeeReceiver {
78
+
function receiveAuctionProceedings(
79
+
bytes calldata permissionKey
80
+
) external payable;
81
+
}
82
+
```
83
+
84
+
85
+
86
+
67
87
68
88
69
-
The following code snippet shows a sample liquidation how to update the protocol's contract to permit Express Relay transactions:
89
+
The following code snippet shows a sample liquidation method and updates to the protocol's contract to permit Express Relay transactions:
0 commit comments