Skip to content

Commit d16b669

Browse files
committed
(WIP) Express relay docs
1 parent ce9082d commit d16b669

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

pages/express-relay/how-express-relay-works/auction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ The revenue from the auction is shared amongst relevant stakeholders in the Expr
1616
- the protocol that generated the relevant opportunity
1717
- the relayer, which handled running the off-chain components of the system
1818

19-
The contract enforces the exact revenue splits in the Express Relay and is subject to change based on governance decisions.
19+
The Express Relay contract enforces the exact revenue splits and is subject to change based on governance decisions.
Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
# Permissionin ID
22

3-
`permissionId` is a `bytes` object that represents the unique identifying information of a position within the protocol. `permissionId` allows the system to distinguish between bids competing on different opportunities and thereby run more scoped and efficient auctions.
3+
`permissionId` is a `bytes` object that represents the unique identifying information of a position within the protocol. `PermissionId` allows the system to distinguish between bids competing on different opportunities and thereby run more scoped and efficient auctions.
44

5-
For some protocols, each borrower has a unique position, so the borrower address uniquely identifies a position. For other protocols, each borrower might have multiple positions, distinguished by the address of the collateral asset or by a uint256 id number. In those cases, the set of information that uniquely identifies a position would include multiple fields.
5+
Each borrower has a unique position for some protocols, so the borrower address uniquely identifies a position.
6+
Whereas in some protocols, each borrower might have multiple positions, distinguished by the address of the collateral asset or by a `uint256` ID number.
7+
In those cases, the information set that uniquely identifies a position would include multiple fields.
68

7-
`permissionId` is the concatenation of all these fields in bytes format. To concatenate these fields together, you can call `abi.encode()`. For example, if a protocol featured a unique position per borrower, then it could form `permissionId` as
9+
`permissionId` is the concatenation of all these fields in bytes format. You can call `abi.encode(){:solidity}` to concatenate these fields together.
810

9-
```
11+
For example, if a protocol featured a unique position per borrower, then it could form `permissionId` as
12+
13+
```solidity
1014
bytes memory permissionId = abi.encode(borrowerAddress);
1115
```
1216

13-
On the other hand, if a protocol allowed a borrower to open as many new positions as they wanted, denoted by an identifier `uint256 positionId`, then it could form permissionId as
1417

15-
```
18+
On the other hand, if a protocol allowed a borrower to open as many new positions as they wanted, denoted by an identifier `uint256 positionId{:solidity}`, then it could form `permissionId` as
19+
20+
```solidity
1621
bytes memory permissionId = abi.encode(borrowerAddress, positionId);
1722
```
1823

19-
The `permissionId` is used in the `ExpressRelay` contract to toggle permissions for interacting with the protocol. This toggling is checked within the protocol's code to ensure that the current transaction is within the context of Express Relay, so that recaptured value can be returned to the protocol.
24+
The Express Relay contract uses the `permissionId` to toggle permissions for interacting with the protocol.
25+
This toggling is checked within the protocol's code to ensure that the current transaction is within the context of Express Relay so that the recaptured value can be returned to the protocol.

0 commit comments

Comments
 (0)